diff options
author | prep@lindenlab.com <prep@lindenlab.com> | 2013-06-14 12:34:45 -0500 |
---|---|---|
committer | prep@lindenlab.com <prep@lindenlab.com> | 2013-06-14 12:34:45 -0500 |
commit | 8c35b1b58bad66bfb5302e598536c0262263cbcb (patch) | |
tree | 67b0ecd3292632dc749d9d4bb967641928c65b53 /indra/newview | |
parent | 4cf208cc7c5065f55e3e6ec121ec65a85775e0c7 (diff) |
WIP: sh-4035 backed out changes to appearance window confirmation
Diffstat (limited to 'indra/newview')
-rwxr-xr-x | indra/newview/llfloatersidepanelcontainer.cpp | 96 | ||||
-rwxr-xr-x | indra/newview/llfloatersidepanelcontainer.h | 16 | ||||
-rwxr-xr-x | indra/newview/llsidepanelappearance.cpp | 160 | ||||
-rwxr-xr-x | indra/newview/llsidepanelappearance.h | 24 | ||||
-rwxr-xr-x | indra/newview/skins/default/xui/en/notifications.xml | 34 |
5 files changed, 27 insertions, 303 deletions
diff --git a/indra/newview/llfloatersidepanelcontainer.cpp b/indra/newview/llfloatersidepanelcontainer.cpp index 02216420da..5f9556a870 100755 --- a/indra/newview/llfloatersidepanelcontainer.cpp +++ b/indra/newview/llfloatersidepanelcontainer.cpp @@ -40,29 +40,13 @@ const std::string LLFloaterSidePanelContainer::sMainPanelName("main_panel"); LLFloaterSidePanelContainer::LLFloaterSidePanelContainer(const LLSD& key, const Params& params) -: LLFloater(key, params) -, mAppQuiting( false ) +: LLFloater(key, params) { // 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 ) -{ - mAppQuiting = confirm.asBoolean(); - onClickCloseBtn(); -} - - LLFloaterSidePanelContainer::~LLFloaterSidePanelContainer() { LLTransientFloaterMgr::getInstance()->removeControlView(LLTransientFloaterMgr::GLOBAL, this); @@ -71,34 +55,26 @@ LLFloaterSidePanelContainer::~LLFloaterSidePanelContainer() void LLFloaterSidePanelContainer::onOpen(const LLSD& key) { getChild<LLPanel>(sMainPanelName)->onOpen(key); - mAppQuiting = false; -} - -void LLFloaterSidePanelContainer::onClose( bool app_quitting ) -{ - if (! mAppQuiting ) { mForceCloseAfterVerify = true; } - LLSidepanelAppearance* panel = getSidePanelAppearance(); - if ( panel ) - { - panel->mRevertSet = true; - panel->onCloseFromAppearance( this ); - } } void LLFloaterSidePanelContainer::onClickCloseBtn() { - LLSidepanelAppearance* panel = getSidePanelAppearance(); - if ( panel ) - { - panel->onClose( this ); - } - else + LLPanelOutfitEdit* panel_outfit_edit = + dynamic_cast<LLPanelOutfitEdit*>(LLFloaterSidePanelContainer::getPanel("appearance", "panel_outfit_edit")); + if (panel_outfit_edit) { - LLFloater::onClickCloseBtn(); + LLFloater *parent = gFloaterView->getParentFloater(panel_outfit_edit); + if (parent == this ) + { + LLSidepanelAppearance* panel_appearance = dynamic_cast<LLSidepanelAppearance*>(getPanel("appearance")); + if ( panel_appearance ) + { + panel_appearance->getWearable()->onClose(); + panel_appearance->showOutfitsInventoryPanel(); + } + } } -} -void LLFloaterSidePanelContainer::close() -{ + LLFloater::onClickCloseBtn(); } @@ -109,7 +85,7 @@ LLPanel* LLFloaterSidePanelContainer::openChildPanel(const std::string& panel_na if (!getVisible()) { - openFloater(); + openFloater(); } LLPanel* panel = NULL; @@ -130,30 +106,10 @@ LLPanel* LLFloaterSidePanelContainer::openChildPanel(const std::string& panel_na void LLFloaterSidePanelContainer::showPanel(const std::string& floater_name, const LLSD& key) { - //If we're already open then check whether anything is dirty - LLFloaterSidePanelContainer* floaterp = LLFloaterReg::getTypedInstance<LLFloaterSidePanelContainer>(floater_name); + LLFloaterSidePanelContainer* floaterp = LLFloaterReg::getTypedInstance<LLFloaterSidePanelContainer>(floater_name); if (floaterp) { - if ( floaterp->getVisible() ) - { - LLSidepanelAppearance* panel = floaterp->getSidePanelAppearance(); - if ( panel ) - { - if ( panel->checkForDirtyEdits() ) - { - panel->onClickConfirmExitWithoutSaveIntoAppearance( floaterp ); - } - else - { - //or a call into some new f() that just shows inv panel? - floaterp->openChildPanel(sMainPanelName, key); - } - } - } - else - { - floaterp->openChildPanel(sMainPanelName, key); - } + floaterp->openChildPanel(sMainPanelName, key); } } @@ -177,19 +133,3 @@ 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; - -} diff --git a/indra/newview/llfloatersidepanelcontainer.h b/indra/newview/llfloatersidepanelcontainer.h index b276821805..491723471f 100755 --- a/indra/newview/llfloatersidepanelcontainer.h +++ b/indra/newview/llfloatersidepanelcontainer.h @@ -30,8 +30,6 @@ #include "llfloater.h" -class LLSidepanelAppearance; - /** * Class LLFloaterSidePanelContainer * @@ -44,8 +42,6 @@ class LLSidepanelAppearance; */ class LLFloaterSidePanelContainer : public LLFloater { - friend class LLSidePanelAppearance; - private: static const std::string sMainPanelName; @@ -54,15 +50,11 @@ public: ~LLFloaterSidePanelContainer(); /*virtual*/ void onOpen(const LLSD& key); - /*virtual*/ void onClose(bool app_quitting); + /*virtual*/ void onClickCloseBtn(); - /*virtual*/ BOOL postBuild(); - void onConfirmationClose( const LLSD &confirm ); LLPanel* openChildPanel(const std::string& panel_name, const LLSD& params); - void close(); - static void showPanel(const std::string& floater_name, const LLSD& key); static void showPanel(const std::string& floater_name, const std::string& panel_name, const LLSD& key); @@ -86,12 +78,6 @@ public: } return panel; } - -private: - LLSidepanelAppearance* getSidePanelAppearance(); - -public: - bool mAppQuiting; }; #endif // LL_LLFLOATERSIDEPANELCONTAINER_H diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp index 775c148ea1..d25d203feb 100755 --- a/indra/newview/llsidepanelappearance.cpp +++ b/indra/newview/llsidepanelappearance.cpp @@ -48,9 +48,6 @@ #include "llviewerregion.h" #include "llvoavatarself.h" #include "llviewerwearable.h" -#include "llnotificationsutil.h" -#include "llfloatersidepanelcontainer.h" -#include "llviewerfoldertype.h" static LLRegisterPanelClassWrapper<LLSidepanelAppearance> t_appearance("sidepanel_appearance"); @@ -73,139 +70,13 @@ private: LLSidepanelAppearance *mPanel; }; -bool LLSidepanelAppearance::callBackExitWithoutSaveViaBack(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - if ( option == 0 ) - { - LLAppearanceMgr::instance().setOutfitDirty( true ); - showOutfitsInventoryPanel(); - LLAppearanceMgr::getInstance()->wearBaseOutfit(); - return true; - } - return false; -} - -void LLSidepanelAppearance::onCloseFromAppearance(LLFloaterSidePanelContainer* obj) -{ - mLLFloaterSidePanelContainer = obj; - if ( mEditWearable->isAvailable() && mEditWearable->isDirty() ) - { - LLSidepanelAppearance* pSelf = (LLSidepanelAppearance *)this; - LLNotificationsUtil::add("ConfirmExitWithoutSave", LLSD(), LLSD(), boost::bind(&LLSidepanelAppearance::callBackExitWithoutSaveViaClose,pSelf,_1,_2) ); - } - else - { - LLVOAvatarSelf::onCustomizeEnd(FALSE); - toggleWearableEditPanel(FALSE); - mLLFloaterSidePanelContainer->mForceCloseAfterVerify=false; - } -} -bool LLSidepanelAppearance::onSaveCommit(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - if (0 == option) - { - std::string outfit_name = response["message"].asString(); - LLStringUtil::trim(outfit_name); - std::string current_outfit_name; - - LLAppearanceMgr::getInstance()->getBaseOutfitName(current_outfit_name); - - if ( current_outfit_name == outfit_name ) - { - LLAppearanceMgr::getInstance()->updateBaseOutfit(); - } - else - { - LLUUID outfit_folder = LLAppearanceMgr::getInstance()->makeNewOutfitLinks( outfit_name,FALSE ); - } - - LLVOAvatarSelf::onCustomizeEnd( FALSE ); - mLLFloaterSidePanelContainer->close(); - } - - return false; -} -bool LLSidepanelAppearance::callBackExitWithoutSaveViaClose(const LLSD& notification, const LLSD& response) -{ S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - if ( option == 0 ) - { - std::string outfit_name; - if (!LLAppearanceMgr::getInstance()->getBaseOutfitName(outfit_name)) - { - outfit_name = LLViewerFolderType::lookupNewCategoryName(LLFolderType::FT_OUTFIT); - } - - LLSD args; - args["DESC"] = outfit_name; - - LLSD payload; - LLNotificationsUtil::add("SaveOutfitEither", args, payload, boost::bind(&LLSidepanelAppearance::onSaveCommit, this, _1, _2)); - showOutfitEditPanel(); - return false; - } - else if ( option == 1 ) - { - mEditWearable->revertChanges(); - toggleWearableEditPanel(FALSE); - showOutfitEditPanel(); - LLVOAvatarSelf::onCustomizeEnd( FALSE ); - if ( !mLLFloaterSidePanelContainer->mAppQuiting ) - { - mRevertSet = true; - } - else - { - mLLFloaterSidePanelContainer->closeFloater( true ); - } - return false; - } - mLLFloaterSidePanelContainer->mForceCloseAfterVerify = false; - return false; -} - -void LLSidepanelAppearance::onClickConfirmExitWithoutSaveIntoAppearance( LLFloaterSidePanelContainer* obj ) -{ - mLLFloaterSidePanelContainer = obj; - if ( LLAppearanceMgr::getInstance()->isOutfitDirty() || mEditWearable->isDirty() ) - { - LLSidepanelAppearance* pSelf = (LLSidepanelAppearance *)this; - LLNotificationsUtil::add("ConfirmExitWithoutSave", LLSD(), LLSD(), boost::bind(&LLSidepanelAppearance::callBackExitWithoutSaveViaClose,pSelf,_1,_2) ); - } - else - { - showOutfitsInventoryPanel(); - } -} -void LLSidepanelAppearance::onClickConfirmExitWithoutSaveViaBack() -{ - showOutfitsInventoryPanel(); -} - -void LLSidepanelAppearance::onClose(LLFloaterSidePanelContainer* obj) -{ mLLFloaterSidePanelContainer = obj; - if ( mEditWearable->isAvailable() && mEditWearable->isDirty() ) - { - LLSidepanelAppearance* pSelf = (LLSidepanelAppearance *)this; - LLNotificationsUtil::add("ConfirmExitWithoutSave", LLSD(), LLSD(), boost::bind(&LLSidepanelAppearance::callBackExitWithoutSaveViaClose,pSelf,_1,_2) ); - } - else - { - LLVOAvatarSelf::onCustomizeEnd(FALSE); - mLLFloaterSidePanelContainer->close(); - } -} - LLSidepanelAppearance::LLSidepanelAppearance() : LLPanel(), mFilterSubString(LLStringUtil::null), mFilterEditor(NULL), mOutfitEdit(NULL), mCurrOutfitPanel(NULL), - mOpened(false), - mSidePanelJustOpened(true), - mRevertSet(false) + mOpened(false) { LLOutfitObserver& outfit_observer = LLOutfitObserver::instance(); outfit_observer.addBOFReplacedCallback(boost::bind(&LLSidepanelAppearance::refreshCurrentOutfitName, this, "")); @@ -214,8 +85,6 @@ LLSidepanelAppearance::LLSidepanelAppearance() : gAgentWearables.addLoadingStartedCallback(boost::bind(&LLSidepanelAppearance::setWearablesLoading, this, true)); gAgentWearables.addLoadedCallback(boost::bind(&LLSidepanelAppearance::setWearablesLoading, this, false)); - - } LLSidepanelAppearance::~LLSidepanelAppearance() @@ -250,8 +119,8 @@ BOOL LLSidepanelAppearance::postBuild() { LLButton* back_btn = mOutfitEdit->getChild<LLButton>("back_btn"); if (back_btn) - { - back_btn->setClickedCallback(boost::bind(&LLSidepanelAppearance::onClickConfirmExitWithoutSaveViaBack, this)); + { + back_btn->setClickedCallback(boost::bind(&LLSidepanelAppearance::showOutfitsInventoryPanel, this)); } } @@ -275,7 +144,6 @@ BOOL LLSidepanelAppearance::postBuild() setVisibleCallback(boost::bind(&LLSidepanelAppearance::onVisibilityChange,this,_2)); - return TRUE; } @@ -286,15 +154,11 @@ void LLSidepanelAppearance::onOpen(const LLSD& key) { // No specific panel requested. // If we're opened for the first time then show My Outfits. - // Else show outfit edit panel + // Else do nothing. if (!mOpened) { showOutfitsInventoryPanel(); } - else - { - showOutfitEditPanel(); - } } else { @@ -319,12 +183,6 @@ void LLSidepanelAppearance::onOpen(const LLSD& key) void LLSidepanelAppearance::onVisibilityChange(const LLSD &new_visibility) { - //handle leaving and subsequent user verification of discarding any unsaved data - if ( mSidePanelJustOpened ) - { - mSidePanelJustOpened = false; - } - LLSD visibility; visibility["visible"] = new_visibility.asBoolean(); visibility["reset_accordion"] = false; @@ -333,9 +191,8 @@ 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(); @@ -596,6 +453,7 @@ void LLSidepanelAppearance::editWearable(LLViewerWearable *wearable, LLView *dat LLSidepanelAppearance *panel = dynamic_cast<LLSidepanelAppearance*>(data); if (panel) { + panel->showOutfitsInventoryPanel(); panel->showWearableEditPanel(wearable, disable_camera_switch); } } @@ -686,9 +544,3 @@ void LLSidepanelAppearance::updateScrollingPanelList() mEditWearable->updateScrollingPanelList(); } } - -bool LLSidepanelAppearance::checkForDirtyEdits() -{ - return ( mEditWearable->isDirty() ) ? true : false; -} - diff --git a/indra/newview/llsidepanelappearance.h b/indra/newview/llsidepanelappearance.h index 5042e92f4b..762f557a80 100755 --- a/indra/newview/llsidepanelappearance.h +++ b/indra/newview/llsidepanelappearance.h @@ -38,11 +38,9 @@ class LLCurrentlyWornFetchObserver; class LLPanelEditWearable; class LLViewerWearable; class LLPanelOutfitsInventory; -class LLFloaterSidePanelContainer; class LLSidepanelAppearance : public LLPanel -{ - +{ LOG_CLASS(LLSidepanelAppearance); public: LLSidepanelAppearance(); @@ -50,9 +48,6 @@ public: /*virtual*/ BOOL postBuild(); /*virtual*/ void onOpen(const LLSD& key); - /*virtual*/ void onClose(LLFloaterSidePanelContainer* obj); - - void onClickCloseBtn(); void refreshCurrentOutfitName(const std::string& name = ""); @@ -70,12 +65,6 @@ public: void updateScrollingPanelList(); void updateToVisibility( const LLSD& new_visibility ); LLPanelEditWearable* getWearable(){ return mEditWearable; } - bool callBackExitWithoutSaveViaBack(const LLSD& notification, const LLSD& response); - void onClickConfirmExitWithoutSaveViaBack(); - bool callBackExitWithoutSaveViaClose(const LLSD& notification, const LLSD& response); - bool checkForDirtyEdits(); - void onClickConfirmExitWithoutSaveIntoAppearance(LLFloaterSidePanelContainer* obj); - void onCloseFromAppearance(LLFloaterSidePanelContainer* obj); private: void onFilterEdit(const std::string& search_string); @@ -88,9 +77,6 @@ private: void toggleOutfitEditPanel(BOOL visible, BOOL disable_camera_switch = FALSE); void toggleWearableEditPanel(BOOL visible, LLViewerWearable* wearable = NULL, BOOL disable_camera_switch = FALSE); - - bool onSaveCommit(const LLSD& notification, const LLSD& response); - LLFilterEditor* mFilterEditor; LLPanelOutfitsInventory* mPanelOutfitsInventory; LLPanelOutfitEdit* mOutfitEdit; @@ -99,7 +85,6 @@ private: LLButton* mOpenOutfitBtn; LLButton* mEditAppearanceBtn; LLButton* mNewOutfitBtn; - LLPanel* mCurrOutfitPanel; LLTextBox* mCurrentLookName; @@ -114,13 +99,6 @@ private: // Gets set to true when we're opened for the first time. bool mOpened; - // Set to true if sidepanel has just been opened - bool mSidePanelJustOpened; - LLFloaterSidePanelContainer* mLLFloaterSidePanelContainer; - -public: - - bool mRevertSet; }; #endif //LL_LLSIDEPANELAPPEARANCE_H diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 860dabdcc8..c3d8a528c5 100755 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -10114,37 +10114,5 @@ Cannot create large prims that intersect other players. Please re-try when othe </notification> - <notification - icon="alertmodal.tga" - name="ConfirmExitWithoutSave" - type="alertmodal"> - You have not saved the changes to your outfit. Would you like to save it now? - <tag>confirm</tag> - <usetemplate - name="yesnocancelbuttons" - notext="Revert" - yestext="Yes" - canceltext="Dismiss"/> - </notification> - - <notification - icon="alertmodal.tga" - label="Save Outfit" - name="SaveOutfitEither" - type="alertmodal"> - <unique/> - Save outfit (defaults to current outfit): - <tag>confirm</tag> - <form name="form"> - <input name="message" type="text"> - [DESC] - </input> - <button - default="true" - index="0" - name="OK" - text="Save"/> - </form> - </notification> - + </notifications> |