diff options
author | prep@lindenlab.com <prep@lindenlab.com> | 2013-05-10 13:57:02 -0500 |
---|---|---|
committer | prep@lindenlab.com <prep@lindenlab.com> | 2013-05-10 13:57:02 -0500 |
commit | 3f1d360a04c4e4d8f07b7e93cd926961ae379430 (patch) | |
tree | b85715de2e337d6ef4a4409b7babaf5e7c243685 /indra/newview | |
parent | 43224062a64cc658d429e434a7b673fac0b7c012 (diff) |
SH-4035: Removed prompt to save if av just has outfit changes. Hooked up logic to handle ctrl+w and ctrl+shift+w confirmation prompts
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llfloatersidepanelcontainer.cpp | 33 | ||||
-rw-r--r-- | indra/newview/llfloatersidepanelcontainer.h | 3 | ||||
-rw-r--r-- | indra/newview/llsidepanelappearance.cpp | 22 |
3 files changed, 47 insertions, 11 deletions
diff --git a/indra/newview/llfloatersidepanelcontainer.cpp b/indra/newview/llfloatersidepanelcontainer.cpp index 4dd558c9c0..43ee54ecd2 100644 --- a/indra/newview/llfloatersidepanelcontainer.cpp +++ b/indra/newview/llfloatersidepanelcontainer.cpp @@ -45,6 +45,39 @@ LLFloaterSidePanelContainer::LLFloaterSidePanelContainer(const LLSD& key, const // Prevent transient floaters (e.g. IM windows) from hiding // when this floater is clicked. LLTransientFloaterMgr::getInstance()->addControlView(LLTransientFloaterMgr::GLOBAL, this); + //We want this container to handle the shutdown logic of the sidepanelappearance. + mVerifyUponClose = TRUE; +} + +BOOL LLFloaterSidePanelContainer::postBuild() +{ + setCloseConfirmationCallback( boost::bind(&LLFloaterSidePanelContainer::onConfirmationClose,this,_2)); + return TRUE; +} + +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() diff --git a/indra/newview/llfloatersidepanelcontainer.h b/indra/newview/llfloatersidepanelcontainer.h index 940673b643..26fc092200 100644 --- a/indra/newview/llfloatersidepanelcontainer.h +++ b/indra/newview/llfloatersidepanelcontainer.h @@ -50,8 +50,9 @@ public: ~LLFloaterSidePanelContainer(); /*virtual*/ void onOpen(const LLSD& key); - /*virtual*/ void onClickCloseBtn(); + /*virtual*/ BOOL postBuild(); + void onConfirmationClose( const LLSD &confirm ); LLPanel* openChildPanel(const std::string& panel_name, const LLSD& params); diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp index 77e9604460..f77275fd1c 100644 --- a/indra/newview/llsidepanelappearance.cpp +++ b/indra/newview/llsidepanelappearance.cpp @@ -90,11 +90,12 @@ bool LLSidepanelAppearance::callBackExitWithoutSaveViaClose(const LLSD& notifica S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if ( option == 0 ) { - //revert curernt edits - mEditWearable->revertChanges(); - toggleWearableEditPanel(FALSE); - LLVOAvatarSelf::onCustomizeEnd(FALSE); - mLLFloaterSidePanelContainer->close(); + //revert current edits + mEditWearable->revertChanges(); + //LLAppearanceMgr::getInstance()->wearBaseOutfit(); + toggleWearableEditPanel(FALSE); + LLVOAvatarSelf::onCustomizeEnd( FALSE ); + mLLFloaterSidePanelContainer->close(); return true; } return false; @@ -115,7 +116,7 @@ void LLSidepanelAppearance::onClickConfirmExitWithoutSaveViaClose() void LLSidepanelAppearance::onClickConfirmExitWithoutSaveViaBack() { - if ( LLAppearanceMgr::getInstance()->isOutfitDirty() && !mSidePanelJustOpened && !LLAppearanceMgr::getInstance()->isOutfitLocked() ) + if ( LLAppearanceMgr::getInstance()->isOutfitDirty() && !mSidePanelJustOpened /*&& !LLAppearanceMgr::getInstance()->isOutfitLocked()*/ ) { LLSidepanelAppearance* pSelf = (LLSidepanelAppearance *)this; LLNotificationsUtil::add("ConfirmExitWithoutSave", LLSD(), LLSD(), boost::bind(&LLSidepanelAppearance::callBackExitWithoutSaveViaBack,pSelf,_1,_2) ); @@ -128,9 +129,9 @@ void LLSidepanelAppearance::onClickConfirmExitWithoutSaveViaBack() void LLSidepanelAppearance::onClose(LLFloaterSidePanelContainer* obj) { - mLLFloaterSidePanelContainer = obj; - if ( LLAppearanceMgr::getInstance()->isOutfitDirty() && - !LLAppearanceMgr::getInstance()->isOutfitLocked() || + mLLFloaterSidePanelContainer = obj; + if ( /*LLAppearanceMgr::getInstance()->isOutfitDirty() && */ + /*!LLAppearanceMgr::getInstance()->isOutfitLocked() ||*/ ( mEditWearable->isAvailable() && mEditWearable->isDirty() ) ) { LLSidepanelAppearance* pSelf = (LLSidepanelAppearance *)this; @@ -275,8 +276,9 @@ void LLSidepanelAppearance::onVisibilityChange(const LLSD &new_visibility) void LLSidepanelAppearance::updateToVisibility(const LLSD &new_visibility) { - if (new_visibility["visible"].asBoolean()) + if (new_visibility["visible"].asBoolean() ) { + const BOOL is_outfit_edit_visible = mOutfitEdit && mOutfitEdit->getVisible(); const BOOL is_wearable_edit_visible = mEditWearable && mEditWearable->getVisible(); |