diff options
author | prep@lindenlab.com <prep@lindenlab.com> | 2013-05-28 11:51:11 -0500 |
---|---|---|
committer | prep@lindenlab.com <prep@lindenlab.com> | 2013-05-28 11:51:11 -0500 |
commit | c498f53d9ab02a41886b55762883d116801fd39b (patch) | |
tree | 027fd1825c5837e51fa8c460d0735a6a19c2b9da | |
parent | 34d2cd03765b6b9b582035a933f4ec11fb262ff4 (diff) |
Sh-4035: Updated implementation according to new specs. Fixed a couple of outstanding bugs.
-rwxr-xr-x | indra/llui/llfloater.cpp | 12 | ||||
-rwxr-xr-x | indra/llui/llpanel.cpp | 3 | ||||
-rwxr-xr-x | indra/llui/llpanel.h | 5 | ||||
-rwxr-xr-x | indra/newview/llfloatersidepanelcontainer.cpp | 13 | ||||
-rwxr-xr-x | indra/newview/llfloatersidepanelcontainer.h | 3 | ||||
-rwxr-xr-x | indra/newview/llsidepanelappearance.cpp | 125 | ||||
-rwxr-xr-x | indra/newview/llsidepanelappearance.h | 14 | ||||
-rwxr-xr-x | indra/newview/skins/default/xui/en/notifications.xml | 30 |
8 files changed, 139 insertions, 66 deletions
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 28dfda8faf..ae4961559e 100755 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -713,6 +713,18 @@ void LLFloater::closeFloater(bool app_quitting) { llinfos << "Closing floater " << getName() << llendl; + if (!app_quitting) + { + if ( mVerifyUponClose && !mForceCloseAfterVerify ) + { + onClose( app_quitting ); + if ( mForceCloseAfterVerify ) + { + return; + } + } + } + if (app_quitting) { LLFloater::sQuitting = true; diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp index 01165a5718..7b7920f866 100755 --- a/indra/llui/llpanel.cpp +++ b/indra/llui/llpanel.cpp @@ -116,7 +116,8 @@ LLPanel::LLPanel(const LLPanel::Params& p) mXMLFilename(p.filename), mVisibleSignal(NULL), mCloseConfirmationSignal(NULL), - mVerifyUponClose(false) + mVerifyUponClose(false), + mForceCloseAfterVerify(false) // *NOTE: Be sure to also change LLPanel::initFromParams(). We have too // many classes derived from LLPanel to retrofit them all to pass in params. { diff --git a/indra/llui/llpanel.h b/indra/llui/llpanel.h index 1b0beaa5c8..d48fab6dd9 100755 --- a/indra/llui/llpanel.h +++ b/indra/llui/llpanel.h @@ -255,8 +255,6 @@ public: boost::signals2::connection setVisibleCallback( const commit_signal_t::slot_type& cb ); boost::signals2::connection setCloseConfirmationCallback( const commit_signal_t::slot_type& cb ); -public: - const BOOL confirmClose() const { return mVerifyUponClose; } protected: // Override to set not found list @@ -276,6 +274,9 @@ protected: std::string mXMLFilename; //Specific close-down logic in subclass BOOL mVerifyUponClose; +public: + BOOL mForceCloseAfterVerify; + private: BOOL mBgVisible; // any background at all? BOOL mBgOpaque; // use opaque color or image diff --git a/indra/newview/llfloatersidepanelcontainer.cpp b/indra/newview/llfloatersidepanelcontainer.cpp index d5bb8157cf..13a9ba1695 100755 --- a/indra/newview/llfloatersidepanelcontainer.cpp +++ b/indra/newview/llfloatersidepanelcontainer.cpp @@ -70,7 +70,16 @@ void LLFloaterSidePanelContainer::onOpen(const LLSD& key) { getChild<LLPanel>(sMainPanelName)->onOpen(key); } - +void LLFloaterSidePanelContainer::onClose(bool app_quitting) +{ + mForceCloseAfterVerify = true; + LLSidepanelAppearance* panel = getSidePanelAppearance(); + if ( panel ) + { + panel->mRevertSet = true; + panel->onCloseFromAppearance( this ); + } +} void LLFloaterSidePanelContainer::onClickCloseBtn() { LLSidepanelAppearance* panel = getSidePanelAppearance(); @@ -127,7 +136,7 @@ void LLFloaterSidePanelContainer::showPanel(const std::string& floater_name, con { if ( panel->checkForDirtyEdits() ) { - panel->onClickConfirmExitWithoutSaveIntoAppearance(); + panel->onClickConfirmExitWithoutSaveIntoAppearance( floaterp ); } else { diff --git a/indra/newview/llfloatersidepanelcontainer.h b/indra/newview/llfloatersidepanelcontainer.h index 974934b48f..dc85570f7e 100755 --- a/indra/newview/llfloatersidepanelcontainer.h +++ b/indra/newview/llfloatersidepanelcontainer.h @@ -44,6 +44,8 @@ class LLSidepanelAppearance; */ class LLFloaterSidePanelContainer : public LLFloater { + friend class LLSidePanelAppearance; + private: static const std::string sMainPanelName; @@ -52,6 +54,7 @@ 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 ); diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp index 858ed06544..70da576c83 100755 --- a/indra/newview/llsidepanelappearance.cpp +++ b/indra/newview/llsidepanelappearance.cpp @@ -50,6 +50,7 @@ #include "llviewerwearable.h" #include "llnotificationsutil.h" #include "llfloatersidepanelcontainer.h" +#include "llviewerfoldertype.h" static LLRegisterPanelClassWrapper<LLSidepanelAppearance> t_appearance("sidepanel_appearance"); @@ -85,58 +86,86 @@ bool LLSidepanelAppearance::callBackExitWithoutSaveViaBack(const LLSD& notificat return false; } -bool LLSidepanelAppearance::callBackExitWithoutSaveViaClose(const LLSD& notification, const LLSD& response) +void LLSidepanelAppearance::onCloseFromAppearance(LLFloaterSidePanelContainer* obj) { - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - if ( option == 0 ) - { - //revert current edits - mEditWearable->revertChanges(); - //LLAppearanceMgr::getInstance()->wearBaseOutfit(); - toggleWearableEditPanel(FALSE); - LLVOAvatarSelf::onCustomizeEnd( FALSE ); - mLLFloaterSidePanelContainer->close(); - return true; - } - return false; -} - -void LLSidepanelAppearance::onClickConfirmExitWithoutSaveViaClose() -{ - if ( LLAppearanceMgr::getInstance()->isOutfitDirty() && !LLAppearanceMgr::getInstance()->isOutfitLocked() ) + mLLFloaterSidePanelContainer = obj; + if ( mEditWearable->isAvailable() && mEditWearable->isDirty() ) { LLSidepanelAppearance* pSelf = (LLSidepanelAppearance *)this; LLNotificationsUtil::add("ConfirmExitWithoutSave", LLSD(), LLSD(), boost::bind(&LLSidepanelAppearance::callBackExitWithoutSaveViaClose,pSelf,_1,_2) ); } else - { - showOutfitsInventoryPanel(); + { + LLVOAvatarSelf::onCustomizeEnd(FALSE); + toggleWearableEditPanel(FALSE); + mLLFloaterSidePanelContainer->mForceCloseAfterVerify=false; } } - - -bool LLSidepanelAppearance::callBackExitWithoutSaveIntoAppearance(const LLSD& notification, const LLSD& response) +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 ) { - //revert current edits - mEditWearable->revertChanges(); - toggleWearableEditPanel(FALSE); + 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 ); - //mLLFloaterSidePanelContainer->close(); - showOutfitsInventoryPanel(); - return true; + mRevertSet = true; + return false; } + mLLFloaterSidePanelContainer->mForceCloseAfterVerify = false; + //mRevertSet = true; return false; } -void LLSidepanelAppearance::onClickConfirmExitWithoutSaveIntoAppearance() +void LLSidepanelAppearance::onClickConfirmExitWithoutSaveIntoAppearance( LLFloaterSidePanelContainer* obj ) { - if ( LLAppearanceMgr::getInstance()->isOutfitDirty() && !LLAppearanceMgr::getInstance()->isOutfitLocked() ) + mLLFloaterSidePanelContainer = obj; + if ( LLAppearanceMgr::getInstance()->isOutfitDirty() || mEditWearable->isDirty() ) { LLSidepanelAppearance* pSelf = (LLSidepanelAppearance *)this; - LLNotificationsUtil::add("ConfirmExitWithoutSave", LLSD(), LLSD(), boost::bind(&LLSidepanelAppearance::callBackExitWithoutSaveIntoAppearance,pSelf,_1,_2) ); + LLNotificationsUtil::add("ConfirmExitWithoutSave", LLSD(), LLSD(), boost::bind(&LLSidepanelAppearance::callBackExitWithoutSaveViaClose,pSelf,_1,_2) ); } else { @@ -145,33 +174,19 @@ void LLSidepanelAppearance::onClickConfirmExitWithoutSaveIntoAppearance() } void LLSidepanelAppearance::onClickConfirmExitWithoutSaveViaBack() { - /* - if ( LLAppearanceMgr::getInstance()->isOutfitDirty() && !mSidePanelJustOpened && !LLAppearanceMgr::getInstance()->isOutfitLocked() ) - { - LLSidepanelAppearance* pSelf = (LLSidepanelAppearance *)this; - LLNotificationsUtil::add("ConfirmExitWithoutSave", LLSD(), LLSD(), boost::bind(&LLSidepanelAppearance::callBackExitWithoutSaveViaBack,pSelf,_1,_2) ); - } - else - */ - { - showOutfitsInventoryPanel(); - } + showOutfitsInventoryPanel(); } void LLSidepanelAppearance::onClose(LLFloaterSidePanelContainer* obj) -{ - mLLFloaterSidePanelContainer = obj; - if ( /*LLAppearanceMgr::getInstance()->isOutfitDirty() && */ - /*!LLAppearanceMgr::getInstance()->isOutfitLocked() ||*/ - ( mEditWearable->isAvailable() && mEditWearable->isDirty() ) ) +{ 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->close(); } } @@ -183,7 +198,8 @@ LLSidepanelAppearance::LLSidepanelAppearance() : mOutfitEdit(NULL), mCurrOutfitPanel(NULL), mOpened(false), - mSidePanelJustOpened(true) + mSidePanelJustOpened(true), + mRevertSet(false) { LLOutfitObserver& outfit_observer = LLOutfitObserver::instance(); outfit_observer.addBOFReplacedCallback(boost::bind(&LLSidepanelAppearance::refreshCurrentOutfitName, this, "")); @@ -264,11 +280,15 @@ void LLSidepanelAppearance::onOpen(const LLSD& key) { // No specific panel requested. // If we're opened for the first time then show My Outfits. - // Else do nothing. + // Else show outfit edit panel if (!mOpened) { showOutfitsInventoryPanel(); } + else + { + showOutfitEditPanel(); + } } else { @@ -665,3 +685,4 @@ bool LLSidepanelAppearance::checkForDirtyEdits() { return ( mEditWearable->isDirty() ) ? true : false; } + diff --git a/indra/newview/llsidepanelappearance.h b/indra/newview/llsidepanelappearance.h index caf5be62e9..5042e92f4b 100755 --- a/indra/newview/llsidepanelappearance.h +++ b/indra/newview/llsidepanelappearance.h @@ -50,7 +50,8 @@ public: /*virtual*/ BOOL postBuild(); /*virtual*/ void onOpen(const LLSD& key); - void onClose(LLFloaterSidePanelContainer* obj); + /*virtual*/ void onClose(LLFloaterSidePanelContainer* obj); + void onClickCloseBtn(); void refreshCurrentOutfitName(const std::string& name = ""); @@ -72,10 +73,9 @@ public: bool callBackExitWithoutSaveViaBack(const LLSD& notification, const LLSD& response); void onClickConfirmExitWithoutSaveViaBack(); bool callBackExitWithoutSaveViaClose(const LLSD& notification, const LLSD& response); - void onClickConfirmExitWithoutSaveViaClose(); bool checkForDirtyEdits(); - bool callBackExitWithoutSaveIntoAppearance(const LLSD& notification, const LLSD& response); - void onClickConfirmExitWithoutSaveIntoAppearance(); + void onClickConfirmExitWithoutSaveIntoAppearance(LLFloaterSidePanelContainer* obj); + void onCloseFromAppearance(LLFloaterSidePanelContainer* obj); private: void onFilterEdit(const std::string& search_string); @@ -88,6 +88,9 @@ 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; @@ -115,6 +118,9 @@ private: 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 07c8ecc4dd..860dabdcc8 100755 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -10118,13 +10118,33 @@ Cannot create large prims that intersect other players. Please re-try when othe icon="alertmodal.tga" name="ConfirmExitWithoutSave" type="alertmodal"> - Closing this window will discard any changes you have made. + You have not saved the changes to your outfit. Would you like to save it now? <tag>confirm</tag> <usetemplate - name="okcancelignore" - notext="Cancel" - yestext="OK" - ignoretext="Don't show me this again."/> + 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> |