From 00ba099a9e23103900399803ffc375873fbfe4a3 Mon Sep 17 00:00:00 2001 From: Seth ProductEngine Date: Wed, 21 Sep 2011 19:28:16 +0300 Subject: EXP-1221 FIXED Added a floater container class that provides an interface for all former Side Tray panels. The container implements a unified behavior similar to Side Tray tabs for all floaters: - LLSD params are passed to the main panel (root panel containing other child panels) upon opening the floater via LLFloaterReg, - LLSD params can be passed to one of the child panels using LLFloaterSidePanelContainer::openChildPanel() - transient floaters (e.g. IM windows) should not hide when the container floater is clicked, so that it's possible to drag an inventory item from My Inventory floater to a docked IM window. --- indra/newview/llfloatersidepanelcontainer.cpp | 77 +++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 indra/newview/llfloatersidepanelcontainer.cpp (limited to 'indra/newview/llfloatersidepanelcontainer.cpp') diff --git a/indra/newview/llfloatersidepanelcontainer.cpp b/indra/newview/llfloatersidepanelcontainer.cpp new file mode 100644 index 0000000000..54cdb574b3 --- /dev/null +++ b/indra/newview/llfloatersidepanelcontainer.cpp @@ -0,0 +1,77 @@ +/** + * @file llfloatersidepanelcontainer.cpp + * @brief LLFloaterSidePanelContainer class definition + * + * $LicenseInfo:firstyear=2011&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2011, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llfloatersidepanelcontainer.h" + +// newview includes +#include "llsidetraypanelcontainer.h" +#include "lltransientfloatermgr.h" + +LLFloaterSidePanelContainer::LLFloaterSidePanelContainer(const LLSD& key, const Params& params) +: LLFloater(key, params) +{ + // Prevent transient floaters (e.g. IM windows) from hiding + // when this floater is clicked. + LLTransientFloaterMgr::getInstance()->addControlView(LLTransientFloaterMgr::GLOBAL, this); +} + +LLFloaterSidePanelContainer::~LLFloaterSidePanelContainer() +{ + LLTransientFloaterMgr::getInstance()->removeControlView(LLTransientFloaterMgr::GLOBAL, this); +} + +void LLFloaterSidePanelContainer::onOpen(const LLSD& key) +{ + getChild("main_panel")->onOpen(key); +} + +LLPanel* LLFloaterSidePanelContainer::openChildPanel(const std::string& panel_name, const LLSD& params) +{ + LLView* view = findChildView(panel_name, true); + if (!view) return NULL; + + openFloater(); + + LLPanel* panel = NULL; + + LLSideTrayPanelContainer* container = dynamic_cast(view->getParent()); + if (container) + { + LLSD new_params = params; + new_params[LLSideTrayPanelContainer::PARAM_SUB_PANEL_NAME] = panel_name; + container->onOpen(new_params); + + panel = container->getCurrentPanel(); + } + else if (panel = dynamic_cast(view)) + { + panel->onOpen(params); + } + + return panel; +} -- cgit v1.2.3 From 0cd1988ef7f6f0b0330938fc44c7e35004114609 Mon Sep 17 00:00:00 2001 From: Paul ProductEngine Date: Thu, 22 Sep 2011 14:41:44 +0300 Subject: EXP-1223 FIXED (Create and register a floater for Places side tab) - Added xml for a new floater and registred it in the floaterreg - Removed side tray dependencies - Added static helper method: LLFloaterSidePanelContainer::showPanel --- indra/newview/llfloatersidepanelcontainer.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'indra/newview/llfloatersidepanelcontainer.cpp') diff --git a/indra/newview/llfloatersidepanelcontainer.cpp b/indra/newview/llfloatersidepanelcontainer.cpp index 54cdb574b3..cff46e80eb 100644 --- a/indra/newview/llfloatersidepanelcontainer.cpp +++ b/indra/newview/llfloatersidepanelcontainer.cpp @@ -26,6 +26,7 @@ #include "llviewerprecompiledheaders.h" +#include "llfloaterreg.h" #include "llfloatersidepanelcontainer.h" // newview includes @@ -75,3 +76,12 @@ LLPanel* LLFloaterSidePanelContainer::openChildPanel(const std::string& panel_na return panel; } + +void LLFloaterSidePanelContainer::showPanel(const std::string& floater_name, const LLSD& panel_name) +{ + LLFloaterSidePanelContainer* floaterp = LLFloaterReg::getTypedInstance(floater_name); + if (floaterp) + { + floaterp->openChildPanel("main_panel", panel_name); + } +} -- cgit v1.2.3 From b72c8df1f6aac0932ae587a6a94fd87db5007366 Mon Sep 17 00:00:00 2001 From: Paul ProductEngine Date: Mon, 26 Sep 2011 19:38:12 +0300 Subject: Fixed Linux TeamCity build --- indra/newview/llfloatersidepanelcontainer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llfloatersidepanelcontainer.cpp') diff --git a/indra/newview/llfloatersidepanelcontainer.cpp b/indra/newview/llfloatersidepanelcontainer.cpp index cff46e80eb..cf66fd1792 100644 --- a/indra/newview/llfloatersidepanelcontainer.cpp +++ b/indra/newview/llfloatersidepanelcontainer.cpp @@ -69,7 +69,7 @@ LLPanel* LLFloaterSidePanelContainer::openChildPanel(const std::string& panel_na panel = container->getCurrentPanel(); } - else if (panel = dynamic_cast(view)) + else if ((panel = dynamic_cast(view)) != NULL) { panel->onOpen(params); } -- cgit v1.2.3 From 0f3221e25d6261d7f29b5b37391156c07fde1d0c Mon Sep 17 00:00:00 2001 From: Seth ProductEngine Date: Tue, 27 Sep 2011 21:05:05 +0300 Subject: EXP-1225 FIXED Added a floater for My Inventory side tab. - Replaced calls to LLSideTray with LLFloaterSidePanelContainer. - Added LLFloaterSidePanelContainer::getPanel() for getting custom type panels. --- indra/newview/llfloatersidepanelcontainer.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'indra/newview/llfloatersidepanelcontainer.cpp') diff --git a/indra/newview/llfloatersidepanelcontainer.cpp b/indra/newview/llfloatersidepanelcontainer.cpp index cf66fd1792..c73ec90a12 100644 --- a/indra/newview/llfloatersidepanelcontainer.cpp +++ b/indra/newview/llfloatersidepanelcontainer.cpp @@ -33,6 +33,9 @@ #include "llsidetraypanelcontainer.h" #include "lltransientfloatermgr.h" +//static +const std::string LLFloaterSidePanelContainer::sMainPanelName("main_panel"); + LLFloaterSidePanelContainer::LLFloaterSidePanelContainer(const LLSD& key, const Params& params) : LLFloater(key, params) { @@ -48,7 +51,7 @@ LLFloaterSidePanelContainer::~LLFloaterSidePanelContainer() void LLFloaterSidePanelContainer::onOpen(const LLSD& key) { - getChild("main_panel")->onOpen(key); + getChild(sMainPanelName)->onOpen(key); } LLPanel* LLFloaterSidePanelContainer::openChildPanel(const std::string& panel_name, const LLSD& params) @@ -82,6 +85,17 @@ void LLFloaterSidePanelContainer::showPanel(const std::string& floater_name, con LLFloaterSidePanelContainer* floaterp = LLFloaterReg::getTypedInstance(floater_name); if (floaterp) { - floaterp->openChildPanel("main_panel", panel_name); + floaterp->openChildPanel(sMainPanelName, panel_name); } } + +LLPanel* LLFloaterSidePanelContainer::getPanel(const std::string& floater_name, const std::string& panel_name) +{ + LLFloaterSidePanelContainer* floaterp = LLFloaterReg::getTypedInstance(floater_name); + if (floaterp) + { + return floaterp->findChild(panel_name, true); + } + + return NULL; +} -- cgit v1.2.3