diff options
author | Mike Antipov <mantipov@productengine.com> | 2010-06-17 16:51:04 +0300 |
---|---|---|
committer | Mike Antipov <mantipov@productengine.com> | 2010-06-17 16:51:04 +0300 |
commit | eb973cf6b21457c12272ddb6213e99d332637116 (patch) | |
tree | 7bf80615750c78ef2255886f8fd307f8b96a317b /indra/newview | |
parent | 68b956b0d3069267737e4f26f93f2bba9ee6cd9c (diff) |
EXT-7755 FIXED Updated condition to not show "No Outfit" as a status when outfit is changing.
Implementation details:
* Added flag to LLAgentWearables to determining that outfit is changing. Synchronizing it with mLoadingStartedSignal and mLoadedSignal signals.
* Check this flag when there is no outfit set to show empty title when outfit is being changed.
* Also updated condition to disable "Wear" button when outfit is being changed.
Additional improvements:
* Removed reference to parent LLSidepanelAppearance from the LLPanelOutfitsInventory.
* Now LLSidepanelAppearance is subscribed to mLoadingStartedSignal and mLoadedSignal to update its loading indicator.
Known Issue:
* When new outfit is being worn its name is shown in title for a short moment (loading indicator is shown at this time). Then it is changed with an empty title and is shown when outfit is already worn.
If necessary it should be investigated and fixed in scope of another issue.
Reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/593/
--HG--
branch : product-engine
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llagentwearables.cpp | 13 | ||||
-rw-r--r-- | indra/newview/llagentwearables.h | 7 | ||||
-rw-r--r-- | indra/newview/llpaneloutfitsinventory.cpp | 14 | ||||
-rw-r--r-- | indra/newview/llpaneloutfitsinventory.h | 2 | ||||
-rw-r--r-- | indra/newview/llsidepanelappearance.cpp | 8 |
5 files changed, 24 insertions, 20 deletions
diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 557b3b0a77..05ed6ec350 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -166,6 +166,7 @@ struct LLAgentDumper LLAgentWearables::LLAgentWearables() : mWearablesLoaded(FALSE) +, mCOFChangeInProgress(false) { } @@ -1208,7 +1209,7 @@ void LLAgentWearables::createStandardWearablesAllDone() mWearablesLoaded = TRUE; checkWearablesLoaded(); - mLoadedSignal(); + notifyLoadingFinished(); updateServer(); @@ -1460,7 +1461,7 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it // Start rendering & update the server mWearablesLoaded = TRUE; checkWearablesLoaded(); - mLoadedSignal(); + notifyLoadingFinished(); queryWearableCache(); updateServer(); @@ -1945,7 +1946,7 @@ void LLAgentWearables::updateWearablesLoaded() mWearablesLoaded = (itemUpdatePendingCount()==0); if (mWearablesLoaded) { - mLoadedSignal(); + notifyLoadingFinished(); } } @@ -2111,7 +2112,13 @@ boost::signals2::connection LLAgentWearables::addLoadedCallback(loaded_callback_ void LLAgentWearables::notifyLoadingStarted() { + mCOFChangeInProgress = true; mLoadingStartedSignal(); } +void LLAgentWearables::notifyLoadingFinished() +{ + mCOFChangeInProgress = false; + mLoadedSignal(); +} // EOF diff --git a/indra/newview/llagentwearables.h b/indra/newview/llagentwearables.h index 3295544e04..05913825dd 100644 --- a/indra/newview/llagentwearables.h +++ b/indra/newview/llagentwearables.h @@ -75,6 +75,7 @@ public: BOOL isWearableCopyable(LLWearableType::EType type, U32 index /*= 0*/) const; BOOL areWearablesLoaded() const; + bool isCOFChangeInProgress() const { return mCOFChangeInProgress; } void updateWearablesLoaded(); void checkWearablesLoaded() const; bool canMoveWearable(const LLUUID& item_id, bool closer_to_body); @@ -233,6 +234,7 @@ public: boost::signals2::connection addLoadedCallback(loaded_callback_t cb); void notifyLoadingStarted(); + void notifyLoadingFinished(); private: loading_started_signal_t mLoadingStartedSignal; // should be called before wearables are changed @@ -249,6 +251,11 @@ private: static BOOL mInitialWearablesUpdateReceived; BOOL mWearablesLoaded; std::set<LLUUID> mItemsAwaitingWearableUpdate; + + /** + * True if agent's outfit is being changed now. + */ + BOOL mCOFChangeInProgress; //-------------------------------------------------------------------------------- // Support classes diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp index 7e1bff0961..e2563efb7d 100644 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -224,7 +224,6 @@ private: LLPanelOutfitsInventory::LLPanelOutfitsInventory() : mMyOutfitsPanel(NULL), mCurrentOutfitPanel(NULL), - mParent(NULL), mGearMenu(NULL), mInitialized(false) { @@ -314,11 +313,6 @@ void LLPanelOutfitsInventory::updateVerbs() } } -void LLPanelOutfitsInventory::setParent(LLSidepanelAppearance* parent) -{ - mParent = parent; -} - // virtual void LLPanelOutfitsInventory::onSearchEdit(const std::string& string) { @@ -548,7 +542,7 @@ void LLPanelOutfitsInventory::initListCommandsHandlers() void LLPanelOutfitsInventory::updateListCommands() { bool trash_enabled = isActionEnabled("delete"); - bool wear_enabled = isActionEnabled("wear"); + bool wear_enabled = !gAgentWearables.isCOFChangeInProgress() && isActionEnabled("wear"); bool wear_visible = !isCOFPanelActive(); bool make_outfit_enabled = isActionEnabled("save_outfit"); @@ -827,12 +821,6 @@ BOOL LLPanelOutfitsInventory::isCOFPanelActive() const void LLPanelOutfitsInventory::setWearablesLoading(bool val) { mListCommands->childSetEnabled("wear_btn", !val); - - llassert(mParent); - if (mParent) - { - mParent->setWearablesLoading(val); - } } void LLPanelOutfitsInventory::onWearablesLoaded() diff --git a/indra/newview/llpaneloutfitsinventory.h b/indra/newview/llpaneloutfitsinventory.h index 863dc9dd7c..eabfda7f8c 100644 --- a/indra/newview/llpaneloutfitsinventory.h +++ b/indra/newview/llpaneloutfitsinventory.h @@ -72,7 +72,6 @@ public: // If a compatible listener type is selected, then return a pointer to that. // Otherwise, return NULL. LLFolderViewEventListener* getCorrectListenerForAction(); - void setParent(LLSidepanelAppearance *parent); LLFolderView* getRootFolder(); static LLSidepanelAppearance* getAppearanceSP(); @@ -84,7 +83,6 @@ protected: bool getIsCorrectType(const LLFolderViewEventListener *listenerp) const; private: - LLSidepanelAppearance* mParent; LLSaveFolderState* mSavedFolderState; LLTabContainer* mAppearanceTabs; std::string mFilterSubString; diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp index e2d4f5ad45..0d1be91125 100644 --- a/indra/newview/llsidepanelappearance.cpp +++ b/indra/newview/llsidepanelappearance.cpp @@ -86,6 +86,9 @@ LLSidepanelAppearance::LLSidepanelAppearance() : outfit_observer.addBOFReplacedCallback(boost::bind(&LLSidepanelAppearance::refreshCurrentOutfitName, this, "")); outfit_observer.addBOFChangedCallback(boost::bind(&LLSidepanelAppearance::refreshCurrentOutfitName, this, "")); outfit_observer.addCOFChangedCallback(boost::bind(&LLSidepanelAppearance::refreshCurrentOutfitName, this, "")); + + gAgentWearables.addLoadingStartedCallback(boost::bind(&LLSidepanelAppearance::setWearablesLoading, this, true)); + gAgentWearables.addLoadedCallback(boost::bind(&LLSidepanelAppearance::setWearablesLoading, this, false)); } LLSidepanelAppearance::~LLSidepanelAppearance() @@ -114,7 +117,6 @@ BOOL LLSidepanelAppearance::postBuild() } mPanelOutfitsInventory = dynamic_cast<LLPanelOutfitsInventory *>(getChild<LLPanel>("panel_outfits_inventory")); - mPanelOutfitsInventory->setParent(this); mOutfitEdit = dynamic_cast<LLPanelOutfitEdit*>(getChild<LLPanel>("panel_outfit_edit")); if (mOutfitEdit) @@ -387,7 +389,9 @@ void LLSidepanelAppearance::refreshCurrentOutfitName(const std::string& name) mCurrentLookName->setText(outfit_name); return; } - mCurrentLookName->setText(getString("No Outfit")); + + std::string look_name = gAgentWearables.isCOFChangeInProgress() ? "" : getString("No Outfit"); + mCurrentLookName->setText(look_name); mOpenOutfitBtn->setEnabled(FALSE); } else |