diff options
author | Alexei Arabadji <aarabadji@productengine.com> | 2010-06-04 14:58:48 +0300 |
---|---|---|
committer | Alexei Arabadji <aarabadji@productengine.com> | 2010-06-04 14:58:48 +0300 |
commit | f99a601dbe7d783b8bd80e0791a222ce51bd7dc6 (patch) | |
tree | 9d209ef9623da8c43845e1a9f80584f03c2fed15 /indra/newview/llsidepanelappearance.cpp | |
parent | 411a78826d4166bf8d770c1e195a02858dabdab8 (diff) |
EXT-7485 FIXED Provided update of 'save as' button status and save outfit panel status.
1 published LLCOFObserver as LLOutfitObserver(moved from llpaneloutfitedit.cpp to lloutfitobserver.h)
2 decoupled outfit edit panel and observer by replacing pointer to panel with signals and made observer as singleton
3 moved call of LLAppearanceMgr::getInstance()->updateIsDirty() from outfit edit panel to observer(discussed with IB)
4 modified updating of combo button state on outfit panel using LLOutfitObserver
5 modified refresh of outfit name and status on outfit change event using LLOutfitObserver
6 removed unnecessary LLWatchForOutfitRenameObserver that caused excessive updates of outfit panel status name
--HG--
branch : product-engine
Diffstat (limited to 'indra/newview/llsidepanelappearance.cpp')
-rw-r--r-- | indra/newview/llsidepanelappearance.cpp | 28 |
1 files changed, 4 insertions, 24 deletions
diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp index b66789448f..ef7286b7b4 100644 --- a/indra/newview/llsidepanelappearance.cpp +++ b/indra/newview/llsidepanelappearance.cpp @@ -42,6 +42,7 @@ #include "llfloaterreg.h" #include "llfloaterworldmap.h" #include "llfoldervieweventlistener.h" +#include "lloutfitobserver.h" #include "llpaneleditwearable.h" #include "llpaneloutfitsinventory.h" #include "llsidetray.h" @@ -73,26 +74,6 @@ private: LLSidepanelAppearance *mPanel; }; -class LLWatchForOutfitRenameObserver : public LLInventoryObserver -{ -public: - LLWatchForOutfitRenameObserver(LLSidepanelAppearance *panel) : - mPanel(panel) - {} - virtual void changed(U32 mask); - -private: - LLSidepanelAppearance *mPanel; -}; - -void LLWatchForOutfitRenameObserver::changed(U32 mask) -{ - if (mask & LABEL) - { - mPanel->refreshCurrentOutfitName(); - } -} - LLSidepanelAppearance::LLSidepanelAppearance() : LLPanel(), mFilterSubString(LLStringUtil::null), @@ -101,12 +82,13 @@ LLSidepanelAppearance::LLSidepanelAppearance() : mCurrOutfitPanel(NULL), mOpened(false) { + LLOutfitObserver& outfit_observer = LLOutfitObserver::instance(); + outfit_observer.addBOFChangedCallback(boost::bind(&LLSidepanelAppearance::refreshCurrentOutfitName, this, "")); + outfit_observer.addCOFChangedCallback(boost::bind(&LLSidepanelAppearance::refreshCurrentOutfitName, this, "")); } LLSidepanelAppearance::~LLSidepanelAppearance() { - gInventory.removeObserver(mOutfitRenameWatcher); - delete mOutfitRenameWatcher; } // virtual @@ -160,8 +142,6 @@ BOOL LLSidepanelAppearance::postBuild() mCurrOutfitPanel = getChild<LLPanel>("panel_currentlook"); - mOutfitRenameWatcher = new LLWatchForOutfitRenameObserver(this); - gInventory.addObserver(mOutfitRenameWatcher); setVisibleCallback(boost::bind(&LLSidepanelAppearance::onVisibilityChange,this,_2)); |