summaryrefslogtreecommitdiff
path: root/indra/newview/llfloatersidepanelcontainer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llfloatersidepanelcontainer.cpp')
-rw-r--r--indra/newview/llfloatersidepanelcontainer.cpp63
1 files changed, 41 insertions, 22 deletions
diff --git a/indra/newview/llfloatersidepanelcontainer.cpp b/indra/newview/llfloatersidepanelcontainer.cpp
index 6c5d2570f2..7bc95c2884 100644
--- a/indra/newview/llfloatersidepanelcontainer.cpp
+++ b/indra/newview/llfloatersidepanelcontainer.cpp
@@ -53,31 +53,39 @@ LLFloaterSidePanelContainer::~LLFloaterSidePanelContainer()
LLTransientFloaterMgr::getInstance()->removeControlView(LLTransientFloaterMgr::GLOBAL, this);
}
+bool LLFloaterSidePanelContainer::postBuild()
+{
+ mMainPanel = getChild<LLPanel>(sMainPanelName);
+ return TRUE;
+}
+
void LLFloaterSidePanelContainer::onOpen(const LLSD& key)
{
- getChild<LLPanel>(sMainPanelName)->onOpen(key);
+ mMainPanel->onOpen(key);
}
void LLFloaterSidePanelContainer::closeFloater(bool app_quitting)
{
- LLPanelOutfitEdit* panel_outfit_edit =
- dynamic_cast<LLPanelOutfitEdit*>(LLFloaterSidePanelContainer::findPanel("appearance", "panel_outfit_edit"));
- if (panel_outfit_edit)
+ if(getInstanceName() == "appearance")
{
- LLFloater *parent = gFloaterView->getParentFloater(panel_outfit_edit);
- if (parent == this )
+ LLPanelOutfitEdit* panel_outfit_edit = findChild<LLPanelOutfitEdit>("panel_outfit_edit");
+ if (panel_outfit_edit)
{
- LLSidepanelAppearance* panel_appearance = dynamic_cast<LLSidepanelAppearance*>(getPanel("appearance"));
- if (panel_appearance)
+ LLFloater *parent = gFloaterView->getParentFloater(panel_outfit_edit);
+ if (parent == this)
{
- LLPanelEditWearable *edit_wearable_ptr = panel_appearance->getWearable();
- if (edit_wearable_ptr)
- {
- edit_wearable_ptr->onClose();
- }
- if (!app_quitting)
+ LLSidepanelAppearance* panel_appearance = dynamic_cast<LLSidepanelAppearance*>(mMainPanel);
+ if (panel_appearance)
{
- panel_appearance->showOutfitsInventoryPanel();
+ LLPanelEditWearable *edit_wearable_ptr = panel_appearance->getWearable();
+ if (edit_wearable_ptr)
+ {
+ edit_wearable_ptr->onClose();
+ }
+ if(!app_quitting)
+ {
+ panel_appearance->showOutfitsInventoryPanel();
+ }
}
}
}
@@ -93,10 +101,9 @@ void LLFloaterSidePanelContainer::closeFloater(bool app_quitting)
void LLFloaterSidePanelContainer::onClickCloseBtn(bool app_quitting)
{
- if (!app_quitting)
+ if (!app_quitting && getInstanceName() == "appearance")
{
- LLPanelOutfitEdit* panel_outfit_edit =
- dynamic_cast<LLPanelOutfitEdit*>(LLFloaterSidePanelContainer::findPanel("appearance", "panel_outfit_edit"));
+ LLPanelOutfitEdit* panel_outfit_edit = findChild<LLPanelOutfitEdit>("panel_outfit_edit");
if (panel_outfit_edit)
{
LLFloater* parent = gFloaterView->getParentFloater(panel_outfit_edit);
@@ -206,10 +213,16 @@ void LLFloaterSidePanelContainer::showPanel(std::string_view floater_name, std::
LLPanel* LLFloaterSidePanelContainer::getPanel(std::string_view floater_name, std::string_view panel_name)
{
LLFloaterSidePanelContainer* floaterp = LLFloaterReg::getTypedInstance<LLFloaterSidePanelContainer>(floater_name);
-
if (floaterp)
{
- return floaterp->findChild<LLPanel>(panel_name, true);
+ if (panel_name == sMainPanelName)
+ {
+ return floaterp->mMainPanel;
+ }
+ else
+ {
+ return floaterp->findChild<LLPanel>(panel_name, true);
+ }
}
return NULL;
@@ -218,10 +231,16 @@ LLPanel* LLFloaterSidePanelContainer::getPanel(std::string_view floater_name, st
LLPanel* LLFloaterSidePanelContainer::findPanel(std::string_view floater_name, std::string_view panel_name)
{
LLFloaterSidePanelContainer* floaterp = LLFloaterReg::findTypedInstance<LLFloaterSidePanelContainer>(floater_name);
-
if (floaterp)
{
- return floaterp->findChild<LLPanel>(panel_name, true);
+ if (panel_name == sMainPanelName)
+ {
+ return floaterp->mMainPanel;
+ }
+ else
+ {
+ return floaterp->findChild<LLPanel>(panel_name, true);
+ }
}
return NULL;