summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Antipov <mantipov@productengine.com>2010-06-15 12:38:30 +0300
committerMike Antipov <mantipov@productengine.com>2010-06-15 12:38:30 +0300
commit300cb342919b2bfa62e9c90af5cdb99afa9c962e (patch)
tree49bda52a8d7272beedbd14ec77f6511b7b258f90
parentd1cb678bac7805f7ceef1d711c7cb49731d6ccb4 (diff)
EXT-7794 FIXED Implemented a common-used notification about wearing outfit to display loading indicator.
Details: * Added signal "Wearable Loading Started" in AgentWearables (in parallel with "Wearables Loaded") * Now it is raised from the LLAppearanceMgr::wearInventoryCategory. Reviewed by Vadim Savchuk and Neal Orman at https://codereview.productengine.com/secondlife/r/583/ --HG-- branch : product-engine
-rw-r--r--indra/newview/llagentwearables.cpp12
-rw-r--r--indra/newview/llagentwearables.h7
-rw-r--r--indra/newview/llappearancemgr.cpp1
-rw-r--r--indra/newview/llpaneloutfitsinventory.cpp7
-rw-r--r--indra/newview/llpaneloutfitsinventory.h1
5 files changed, 27 insertions, 1 deletions
diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp
index 342f9a5d80..557b3b0a77 100644
--- a/indra/newview/llagentwearables.cpp
+++ b/indra/newview/llagentwearables.cpp
@@ -2099,7 +2099,19 @@ void LLAgentWearables::populateMyOutfitsFolder(void)
}
}
+boost::signals2::connection LLAgentWearables::addLoadingStartedCallback(loading_started_callback_t cb)
+{
+ return mLoadingStartedSignal.connect(cb);
+}
+
boost::signals2::connection LLAgentWearables::addLoadedCallback(loaded_callback_t cb)
{
return mLoadedSignal.connect(cb);
}
+
+void LLAgentWearables::notifyLoadingStarted()
+{
+ mLoadingStartedSignal();
+}
+
+// EOF
diff --git a/indra/newview/llagentwearables.h b/indra/newview/llagentwearables.h
index a41b949be6..3295544e04 100644
--- a/indra/newview/llagentwearables.h
+++ b/indra/newview/llagentwearables.h
@@ -224,11 +224,18 @@ public:
// Signals
//--------------------------------------------------------------------
public:
+ typedef boost::function<void()> loading_started_callback_t;
+ typedef boost::signals2::signal<void()> loading_started_signal_t;
+ boost::signals2::connection addLoadingStartedCallback(loading_started_callback_t cb);
+
typedef boost::function<void()> loaded_callback_t;
typedef boost::signals2::signal<void()> loaded_signal_t;
boost::signals2::connection addLoadedCallback(loaded_callback_t cb);
+ void notifyLoadingStarted();
+
private:
+ loading_started_signal_t mLoadingStartedSignal; // should be called before wearables are changed
loaded_signal_t mLoadedSignal; // emitted when all agent wearables get loaded
//--------------------------------------------------------------------
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp
index bc17605202..a7206095d3 100644
--- a/indra/newview/llappearancemgr.cpp
+++ b/indra/newview/llappearancemgr.cpp
@@ -1407,6 +1407,7 @@ void LLAppearanceMgr::getUserDescendents(const LLUUID& category,
void LLAppearanceMgr::wearInventoryCategory(LLInventoryCategory* category, bool copy, bool append)
{
+ gAgentWearables.notifyLoadingStarted();
if(!category) return;
llinfos << "wearInventoryCategory( " << category->getName()
diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp
index 1157c40b39..5563214407 100644
--- a/indra/newview/llpaneloutfitsinventory.cpp
+++ b/indra/newview/llpaneloutfitsinventory.cpp
@@ -245,6 +245,7 @@ LLPanelOutfitsInventory::LLPanelOutfitsInventory() :
mSavedFolderState = new LLSaveFolderState();
mSavedFolderState->setApply(FALSE);
gAgentWearables.addLoadedCallback(boost::bind(&LLPanelOutfitsInventory::onWearablesLoaded, this));
+ gAgentWearables.addLoadingStartedCallback(boost::bind(&LLPanelOutfitsInventory::onWearablesLoading, this));
LLOutfitObserver& observer = LLOutfitObserver::instance();
observer.addBOFChangedCallback(boost::bind(&LLPanelOutfitsInventory::updateVerbs, this));
@@ -382,7 +383,6 @@ void LLPanelOutfitsInventory::onWearButtonClick()
if (!isCOFPanelActive())
{
mMyOutfitsPanel->performAction("replaceoutfit");
- setWearablesLoading(true);
}
else
{
@@ -854,6 +854,11 @@ void LLPanelOutfitsInventory::onWearablesLoaded()
setWearablesLoading(false);
}
+void LLPanelOutfitsInventory::onWearablesLoading()
+{
+ setWearablesLoading(true);
+}
+
// static
LLSidepanelAppearance* LLPanelOutfitsInventory::getAppearanceSP()
{
diff --git a/indra/newview/llpaneloutfitsinventory.h b/indra/newview/llpaneloutfitsinventory.h
index d58ae554b0..863dc9dd7c 100644
--- a/indra/newview/llpaneloutfitsinventory.h
+++ b/indra/newview/llpaneloutfitsinventory.h
@@ -127,6 +127,7 @@ protected:
bool hasItemsSelected();
void setWearablesLoading(bool val);
void onWearablesLoaded();
+ void onWearablesLoading();
private:
LLPanel* mListCommands;
LLOutfitListGearMenu* mGearMenu;