diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2013-05-14 12:53:55 -0400 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2013-05-14 12:53:55 -0400 |
commit | 749b5ba3bd7e38a23f373d15b8a74df7dede6a93 (patch) | |
tree | ad0900d65f5e35108b13da6fa4c441c5c0b809a1 /indra/newview/llfloatersidepanelcontainer.cpp | |
parent | b1998cabc487c434555276a389ed19847b98f998 (diff) | |
parent | b7161fcd58853fb60900e51a4ac221b02941905e (diff) |
merge
Diffstat (limited to 'indra/newview/llfloatersidepanelcontainer.cpp')
-rw-r--r-- | indra/newview/llfloatersidepanelcontainer.cpp | 83 |
1 files changed, 45 insertions, 38 deletions
diff --git a/indra/newview/llfloatersidepanelcontainer.cpp b/indra/newview/llfloatersidepanelcontainer.cpp index 43ee54ecd2..3ea39cf196 100644 --- a/indra/newview/llfloatersidepanelcontainer.cpp +++ b/indra/newview/llfloatersidepanelcontainer.cpp @@ -56,30 +56,11 @@ BOOL LLFloaterSidePanelContainer::postBuild() } void LLFloaterSidePanelContainer::onConfirmationClose( const LLSD &confirm ) -{ - /* - LLPanelOutfitEdit* panel_outfit_edit = dynamic_cast<LLPanelOutfitEdit*>(LLFloaterSidePanelContainer::getPanel("appearance", "panel_outfit_edit")); - if (panel_outfit_edit) - { - LLFloater *parent = gFloaterView->getParentFloater(panel_outfit_edit); - if (parent == this ) - { - LLSidepanelAppearance* panel_appearance = dynamic_cast<LLSidepanelAppearance*>(getPanel("appearance")); - panel_appearance->onClose(this); - } - else - { - LLFloater::onClickCloseBtn(); - } - } - else - { - LLFloater::onClickCloseBtn(); - } - */ +{ onClickCloseBtn(); } + LLFloaterSidePanelContainer::~LLFloaterSidePanelContainer() { LLTransientFloaterMgr::getInstance()->removeControlView(LLTransientFloaterMgr::GLOBAL, this); @@ -92,20 +73,10 @@ void LLFloaterSidePanelContainer::onOpen(const LLSD& key) void LLFloaterSidePanelContainer::onClickCloseBtn() { - LLPanelOutfitEdit* panel_outfit_edit = - dynamic_cast<LLPanelOutfitEdit*>(LLFloaterSidePanelContainer::getPanel("appearance", "panel_outfit_edit")); - if (panel_outfit_edit) + LLSidepanelAppearance* panel = getSidePanelAppearance(); + if ( panel ) { - LLFloater *parent = gFloaterView->getParentFloater(panel_outfit_edit); - if (parent == this ) - { - LLSidepanelAppearance* panel_appearance = dynamic_cast<LLSidepanelAppearance*>(getPanel("appearance")); - panel_appearance->onClose(this); - } - else - { - LLFloater::onClickCloseBtn(); - } + panel->onClose( this ); } else { @@ -114,7 +85,7 @@ void LLFloaterSidePanelContainer::onClickCloseBtn() } void LLFloaterSidePanelContainer::close() { - LLFloater::onClickCloseBtn(); + LLFloater::onClickCloseBtn(); } LLPanel* LLFloaterSidePanelContainer::openChildPanel(const std::string& panel_name, const LLSD& params) @@ -124,7 +95,7 @@ LLPanel* LLFloaterSidePanelContainer::openChildPanel(const std::string& panel_na if (!getVisible()) { - openFloater(); + openFloater(); } LLPanel* panel = NULL; @@ -145,10 +116,30 @@ LLPanel* LLFloaterSidePanelContainer::openChildPanel(const std::string& panel_na void LLFloaterSidePanelContainer::showPanel(const std::string& floater_name, const LLSD& key) { - LLFloaterSidePanelContainer* floaterp = LLFloaterReg::getTypedInstance<LLFloaterSidePanelContainer>(floater_name); + //If we're already open then check whether anything is dirty + LLFloaterSidePanelContainer* floaterp = LLFloaterReg::getTypedInstance<LLFloaterSidePanelContainer>(floater_name); if (floaterp) { - floaterp->openChildPanel(sMainPanelName, key); + if ( floaterp->getVisible() ) + { + LLSidepanelAppearance* panel = floaterp->getSidePanelAppearance(); + if ( panel ) + { + if ( panel->checkForDirtyEdits() ) + { + panel->onClickConfirmExitWithoutSaveIntoAppearance(); + } + else + { + //or a call into some new f() that just shows inv panel? + floaterp->openChildPanel(sMainPanelName, key); + } + } + } + else + { + floaterp->openChildPanel(sMainPanelName, key); + } } } @@ -172,3 +163,19 @@ LLPanel* LLFloaterSidePanelContainer::getPanel(const std::string& floater_name, return NULL; } + +LLSidepanelAppearance* LLFloaterSidePanelContainer::getSidePanelAppearance() +{ + LLSidepanelAppearance* panel_appearance = NULL; + LLPanelOutfitEdit* panel_outfit_edit = dynamic_cast<LLPanelOutfitEdit*>(LLFloaterSidePanelContainer::getPanel("appearance", "panel_outfit_edit")); + if (panel_outfit_edit) + { + LLFloater *parent = gFloaterView->getParentFloater(panel_outfit_edit); + if (parent == this ) + { + panel_appearance = dynamic_cast<LLSidepanelAppearance*>(getPanel("appearance")); + } + } + return panel_appearance; + +}
\ No newline at end of file |