automated merge viewer2.0->viewer2.0

meow-7.2.2
Loren Shih 2009-12-21 18:32:35 -05:00
commit e6a8b3e2b2
3 changed files with 76 additions and 8 deletions

View File

@ -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,

View File

@ -1340,8 +1340,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
@ -1616,10 +1615,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
@ -1638,7 +1685,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);
}
@ -1646,7 +1692,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);
}
}

View File

@ -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;