diff options
| author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2009-12-21 17:21:48 -0500 | 
|---|---|---|
| committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2009-12-21 17:21:48 -0500 | 
| commit | ced5b819d74fa70fc2050b13749bfe1387340583 (patch) | |
| tree | 1db75b29eabde12c9bf93108816f48370e1b7541 | |
| parent | d1eb2948f8a65e6f7631d836b2367ebe435e1efa (diff) | |
For EXT-3567: Folders should show as 'Loading...' when contents being fetched
| -rw-r--r-- | indra/newview/llfolderviewitem.cpp | 21 | ||||
| -rw-r--r-- | indra/newview/llinventorymodel.cpp | 55 | ||||
| -rw-r--r-- | indra/newview/llinventorymodel.h | 9 | 
3 files changed, 77 insertions, 8 deletions
| diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index bfd9d6dca7..c430dc96af 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -970,11 +970,26 @@ void LLFolderViewItem::draw()  		font->renderUTF8( mLabel, 0, text_left, y, color, -				   LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -			S32_MAX, getRect().getWidth() - (S32) text_left, &right_x, TRUE); +						  LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, +						  S32_MAX, getRect().getWidth() - (S32) text_left, &right_x, TRUE); +//		LLViewerInventoryCategory *item = 0; +//		if (getListener()) +//			item = gInventory.getCategory(getListener()->getUUID()); +		bool root_is_loading = false; +		if (getListener() && gInventory.isObjectDescendentOf(getListener()->getUUID(),gInventory.getRootFolderID())) +		{ +			// Descendent of my inventory. +			root_is_loading = gInventory.myInventoryFetchInProgress(); +		} +		if (getListener() && gInventory.isObjectDescendentOf(getListener()->getUUID(),gInventory.getLibraryRootFolderID())) +		{ +			// Descendent of library +			root_is_loading = gInventory.libraryFetchInProgress(); +		} +			  		if ( (mIsLoading && mTimeSinceRequestStart.getElapsedTimeF32() >= gSavedSettings.getF32("FolderLoadingMessageWaitTime")) -			|| (LLInventoryModel::backgroundFetchActive() && mShowLoadStatus) ) +			|| (LLInventoryModel::backgroundFetchActive() && root_is_loading && mShowLoadStatus) )  		{  			std::string load_string = " ( " + LLTrans::getString("LoadingData") + " ) ";  			font->renderUTF8(load_string, 0, right_x, y, sSearchStatusColor, diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 0a8108899a..c8fd8d2062 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1339,8 +1339,7 @@ bool LLInventoryModel::fetchDescendentsOf(const LLUUID& folder_id)  //Initialize statics.  bool LLInventoryModel::isBulkFetchProcessingComplete()  { -	return ( (sFetchQueue.empty()  -			&& sBulkFetchCount<=0)  ?  TRUE : FALSE ) ; +	return sFetchQueue.empty() && sBulkFetchCount<=0;  }  class LLInventoryModelFetchDescendentsResponder: public LLHTTPClient::Responder @@ -1615,10 +1614,58 @@ void LLInventoryModel::bulkFetch(std::string url)  	}	  } +bool fetchQueueContainsNoDescendentsOf(const LLUUID& cat_id) +{ +	for (std::deque<LLUUID>::iterator it = sFetchQueue.begin(); +		 it != sFetchQueue.end(); ++it) +	{ +		const LLUUID& fetch_id = *it; +		if (gInventory.isObjectDescendentOf(fetch_id, cat_id)) +			return false; +	} +	return true; +} + +/* static */ +bool LLInventoryModel::libraryFetchStarted() +{ +	return sLibraryFetchStarted; +} + +/* static */ +bool LLInventoryModel::libraryFetchCompleted() +{ +	return libraryFetchStarted() && fetchQueueContainsNoDescendentsOf(gInventory.getLibraryRootFolderID()); +} + +/* static */ +bool LLInventoryModel::libraryFetchInProgress() +{ +	return libraryFetchStarted() && !libraryFetchCompleted(); +} +	 +/* static */ +bool LLInventoryModel::myInventoryFetchStarted() +{ +	return sMyInventoryFetchStarted; +} + +/* static */ +bool LLInventoryModel::myInventoryFetchCompleted() +{ +	return myInventoryFetchStarted() && fetchQueueContainsNoDescendentsOf(gInventory.getRootFolderID()); +} + +/* static */ +bool LLInventoryModel::myInventoryFetchInProgress() +{ +	return myInventoryFetchStarted() && !myInventoryFetchCompleted(); +} +  // static  bool LLInventoryModel::isEverythingFetched()  { -	return (sAllFoldersFetched ? true : false); +	return sAllFoldersFetched;  }  //static @@ -1637,7 +1684,6 @@ void LLInventoryModel::startBackgroundFetch(const LLUUID& cat_id)  			if (!sMyInventoryFetchStarted)  			{  				sMyInventoryFetchStarted = TRUE; -				sFetchQueue.push_back(gInventory.getLibraryRootFolderID());  				sFetchQueue.push_back(gInventory.getRootFolderID());  				gIdleCallbacks.addFunction(&LLInventoryModel::backgroundFetch, NULL);  			} @@ -1645,7 +1691,6 @@ void LLInventoryModel::startBackgroundFetch(const LLUUID& cat_id)  			{  				sLibraryFetchStarted = TRUE;  				sFetchQueue.push_back(gInventory.getLibraryRootFolderID()); -				sFetchQueue.push_back(gInventory.getRootFolderID());  				gIdleCallbacks.addFunction(&LLInventoryModel::backgroundFetch, NULL);  			}  		} diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index 27bbca493d..28c51e97bc 100644 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -516,6 +516,14 @@ public:  	// Add categories to a list to be fetched in bulk.  	static void bulkFetch(std::string url); +	static bool libraryFetchStarted(); +	static bool libraryFetchCompleted(); +	static bool libraryFetchInProgress(); +	 +	static bool myInventoryFetchStarted(); +	static bool myInventoryFetchCompleted(); +	static bool myInventoryFetchInProgress(); +	  private:   	static BOOL sMyInventoryFetchStarted;  	static BOOL sLibraryFetchStarted; @@ -525,6 +533,7 @@ private:  	// completing the fetch once per session should be sufficient  	static BOOL sBackgroundFetchActive;  	static S16 sBulkFetchCount; +  };  // a special inventory model for the agent | 
