Merge remote-tracking branch 'origin/DRTVWR-567' into viewer_bulky_thumbs

master
Callum Prentice 2023-08-11 15:05:43 -07:00
commit 7d849810a4
7 changed files with 134 additions and 52 deletions

View File

@ -32,6 +32,7 @@
#include "llfolderview.h"
#include "llfolderviewmodel.h"
#include "llpanel.h"
#include "llcallbacklist.h"
#include "llcriticaldamp.h"
#include "llclipboard.h"
#include "llfocusmgr.h" // gFocusMgr
@ -1844,7 +1845,12 @@ void LLFolderViewFolder::setOpen(BOOL openitem)
{
if(mSingleFolderMode)
{
getViewModelItem()->navigateToFolder();
// navigateToFolder can destroy this view
// delay it in case setOpen was called from click or key processing
doOnIdleOneTime([this]()
{
getViewModelItem()->navigateToFolder();
});
}
else
{
@ -2074,7 +2080,19 @@ BOOL LLFolderViewFolder::handleDoubleClick( S32 x, S32 y, MASK mask )
if(mSingleFolderMode)
{
static LLUICachedControl<bool> double_click_new_window("SingleModeDoubleClickOpenWindow", false);
getViewModelItem()->navigateToFolder(double_click_new_window);
if (double_click_new_window)
{
getViewModelItem()->navigateToFolder(true);
}
else
{
// navigating is going to destroy views and change children
// delay it untill handleDoubleClick processing is complete
doOnIdleOneTime([this]()
{
getViewModelItem()->navigateToFolder(false);
});
}
return TRUE;
}

View File

@ -703,8 +703,12 @@ void AISAPI::FetchCOF(completion_t callback)
// _6 -> httpHeaders
(&LLCoreHttpUtil::HttpCoroutineAdapter::getAndSuspend), _1, _2, _3, _5, _6);
LLSD body;
// Only cof folder will be full, but cof can contain an outfit
// link with embedded outfit folder for request to parse
body["depth"] = 0;
LLCoprocedureManager::CoProcedure_t proc(boost::bind(&AISAPI::InvokeAISCommandCoro,
_1, getFn, url, LLUUID::null, LLSD(), callback, FETCHCOF));
_1, getFn, url, LLUUID::null, body, callback, FETCHCOF));
EnqueueAISCommand("FetchCOF", proc);
}
@ -982,6 +986,7 @@ void AISAPI::InvokeAISCommandCoro(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t ht
case FETCHITEM:
if (result.has("item_id"))
{
// Error message might contain an item_id!!!
id = result["item_id"];
}
if (result.has("linked_id"))
@ -1163,11 +1168,15 @@ void AISUpdate::parseMeta(const LLSD& update)
void AISUpdate::parseContent(const LLSD& update)
{
if (update.has("linked_id"))
// Errors from a fetch request might contain id without
// full item or folder.
// Todo: Depending on error we might want to do something,
// like removing a 404 item or refetching parent folder
if (update.has("linked_id") && update.has("parent_id"))
{
parseLink(update, mFetchDepth);
}
else if (update.has("item_id"))
else if (update.has("item_id") && update.has("parent_id"))
{
parseItem(update);
}
@ -1181,7 +1190,7 @@ void AISUpdate::parseContent(const LLSD& update)
parseEmbedded(update["_embedded"], mFetchDepth - 1);
}
}
else if (update.has("category_id"))
else if (update.has("category_id") && update.has("parent_id"))
{
parseCategory(update, mFetchDepth);
}
@ -1210,7 +1219,6 @@ void AISUpdate::parseItem(const LLSD& item_map)
if (mFetch)
{
mItemsCreated[item_id] = new_item;
mCatDescendentDeltas[new_item->getParentUUID()];
new_item->setComplete(true);
if (new_item->getParentUUID().isNull())
@ -1264,7 +1272,6 @@ void AISUpdate::parseLink(const LLSD& link_map, S32 depth)
new_link->setSaleInfo(default_sale_info);
//LL_DEBUGS("Inventory") << "creating link from llsd: " << ll_pretty_print_sd(link_map) << LL_ENDL;
mItemsCreated[item_id] = new_link;
mCatDescendentDeltas[parent_id];
new_link->setComplete(true);
if (new_link->getParentUUID().isNull())
@ -1361,17 +1368,6 @@ void AISUpdate::parseCategory(const LLSD& category_map, S32 depth)
{
if (mFetch)
{
// set version only if previous one was already known
// or if we are sure this update has full data and embeded items (depth 0+)
// since bulk fetch uses this to decide what still needs fetching
if (version > LLViewerInventoryCategory::VERSION_UNKNOWN
&& (depth >= 0 || (curr_cat && curr_cat->getVersion() > LLViewerInventoryCategory::VERSION_UNKNOWN)))
{
// Set version/descendents for newly fetched categories.
LL_DEBUGS("Inventory") << "Setting version to " << version
<< " for category " << category_id << LL_ENDL;
new_cat->setVersion(version);
}
uuid_int_map_t::const_iterator lookup_it = mCatDescendentsKnown.find(category_id);
if (mCatDescendentsKnown.end() != lookup_it)
{
@ -1379,9 +1375,28 @@ void AISUpdate::parseCategory(const LLSD& category_map, S32 depth)
LL_DEBUGS("Inventory") << "Setting descendents count to " << descendent_count
<< " for category " << category_id << LL_ENDL;
new_cat->setDescendentCount(descendent_count);
// set version only if we are sure this update has full data and embeded items
// since viewer uses version to decide if folder and content still need fetching
if (version > LLViewerInventoryCategory::VERSION_UNKNOWN
&& (depth >= 0 || (curr_cat && curr_cat->getVersion() > LLViewerInventoryCategory::VERSION_UNKNOWN)))
{
LL_DEBUGS("Inventory") << "Setting version to " << version
<< " for category " << category_id << LL_ENDL;
new_cat->setVersion(version);
}
}
else if (curr_cat
&& curr_cat->getVersion() > LLViewerInventoryCategory::VERSION_UNKNOWN
&& version > curr_cat->getVersion())
{
// Potentially should new_cat->setVersion(unknown) here,
// but might be waiting for a callback that would increment
LL_DEBUGS("Inventory") << "Category " << category_id
<< " is stale. Known version: " << curr_cat->getVersion()
<< " server version: " << version << LL_ENDL;
}
mCategoriesCreated[category_id] = new_cat;
mCatDescendentDeltas[new_cat->getParentUUID()];
}
else if (curr_cat)
{
@ -1396,20 +1411,22 @@ void AISUpdate::parseCategory(const LLSD& category_map, S32 depth)
else
{
// Set version/descendents for newly created categories.
if (category_map.has("version"))
{
S32 version = category_map["version"].asInteger();
LL_DEBUGS("Inventory") << "Setting version to " << version
<< " for new category " << category_id << LL_ENDL;
new_cat->setVersion(version);
}
uuid_int_map_t::const_iterator lookup_it = mCatDescendentsKnown.find(category_id);
if (mCatDescendentsKnown.end() != lookup_it)
{
S32 descendent_count = lookup_it->second;
LL_DEBUGS("Inventory") << "Setting descendents count to " << descendent_count
<< " for new category " << category_id << LL_ENDL;
new_cat->setDescendentCount(descendent_count);
uuid_int_map_t::const_iterator lookup_it = mCatDescendentsKnown.find(category_id);
if (mCatDescendentsKnown.end() != lookup_it)
{
S32 descendent_count = lookup_it->second;
LL_DEBUGS("Inventory") << "Setting descendents count to " << descendent_count
<< " for new category " << category_id << LL_ENDL;
new_cat->setDescendentCount(descendent_count);
// Don't set version unles correct children count is present
if (category_map.has("version"))
{
S32 version = category_map["version"].asInteger();
LL_DEBUGS("Inventory") << "Setting version to " << version
<< " for new category " << category_id << LL_ENDL;
new_cat->setVersion(version);
}
}
mCategoriesCreated[category_id] = new_cat;
mCatDescendentDeltas[new_cat->getParentUUID()]++;

View File

@ -3821,7 +3821,7 @@ void LLAppearanceMgr::serverAppearanceUpdateCoro(LLCoreHttpUtil::HttpCoroutineAd
if (cofVersion == LLViewerInventoryCategory::VERSION_UNKNOWN)
{
LL_WARNS("AVatar") << "COF version is unknown... not requesting until COF version is known." << LL_ENDL;
LL_INFOS("AVatar") << "COF version is unknown... not requesting until COF version is known." << LL_ENDL;
return;
}
else

View File

@ -239,6 +239,12 @@ void LLAttachmentsMgr::linkRecentlyArrivedAttachments()
return;
}
if (LLAppearanceMgr::instance().getCOFVersion() == LLViewerInventoryCategory::VERSION_UNKNOWN)
{
// Wait for cof to load
return;
}
LL_DEBUGS("Avatar") << "ATT checking COF linkability for " << mRecentlyArrivedAttachments.size()
<< " recently arrived items" << LL_ENDL;

View File

@ -2347,6 +2347,7 @@ void LLInventoryGalleryItem::draw()
LLUIColor border_color = LLUIColorTable::instance().getColor(mSelected ? "MenuItemHighlightBgColor" : "TextFgTentativeColor", LLColor4::white);
LLRect border = getChildView("preview_thumbnail")->getRect();
border.mRight = border.mRight + 1;
border.mTop = border.mTop + 1;
gl_rect_2d(border, border_color.get(), FALSE);
}
@ -2449,7 +2450,19 @@ BOOL LLInventoryGalleryItem::handleDoubleClick(S32 x, S32 y, MASK mask)
{
if (mIsFolder && mGallery)
{
mGallery->setRootFolder(mUUID);
// setRootFolder can destroy this item.
// Delay it until handleDoubleClick processing is complete
// or make gallery handle doubleclicks.
LLHandle<LLPanel> handle = mGallery->getHandle();
LLUUID navigate_to = mUUID;
doOnIdleOneTime([handle, navigate_to]()
{
LLInventoryGallery* gallery = (LLInventoryGallery*)handle.get();
if (gallery)
{
gallery->setRootFolder(navigate_to);
}
});
}
else
{

View File

@ -3788,15 +3788,22 @@ void LLInventoryModel::processBulkUpdateInventory(LLMessageSystem* msg, void**)
LLViewerInventoryCategory* folderp = gInventory.getCategory(tfolder->getUUID());
if(folderp)
{
if(tfolder->getParentUUID() == folderp->getParentUUID())
{
update[tfolder->getParentUUID()];
}
else
{
++update[tfolder->getParentUUID()];
--update[folderp->getParentUUID()];
}
if (folderp->getVersion() != LLViewerInventoryCategory::VERSION_UNKNOWN)
{
if (tfolder->getParentUUID() == folderp->getParentUUID())
{
update[tfolder->getParentUUID()];
}
else
{
++update[tfolder->getParentUUID()];
--update[folderp->getParentUUID()];
}
}
else
{
folderp->fetch();
}
}
else
{
@ -3806,7 +3813,14 @@ void LLInventoryModel::processBulkUpdateInventory(LLMessageSystem* msg, void**)
folderp = gInventory.getCategory(tfolder->getParentUUID());
if(folderp)
{
++update[tfolder->getParentUUID()];
if (folderp->getVersion() != LLViewerInventoryCategory::VERSION_UNKNOWN)
{
++update[tfolder->getParentUUID()];
}
else
{
folderp->fetch();
}
}
}
}
@ -3852,7 +3866,14 @@ void LLInventoryModel::processBulkUpdateInventory(LLMessageSystem* msg, void**)
LLViewerInventoryCategory* folderp = gInventory.getCategory(titem->getParentUUID());
if(folderp)
{
++update[titem->getParentUUID()];
if (folderp->getVersion() != LLViewerInventoryCategory::VERSION_UNKNOWN)
{
++update[titem->getParentUUID()];
}
else
{
folderp->fetch();
}
}
}
}

View File

@ -256,7 +256,7 @@ static bool mLoginStatePastUI = false;
static bool mBenefitsSuccessfullyInit = false;
const F32 STATE_AGENT_WAIT_TIMEOUT = 240; //seconds
const S32 MAX_SEED_CAP_ATTEMPTS_BEFORE_LOGIN = 3; // Give region 3 chances
const S32 MAX_SEED_CAP_ATTEMPTS_BEFORE_ABORT = 4; // Give region 4 chances
std::unique_ptr<LLEventPump> LLStartUp::sStateWatcher(new LLEventStream("StartupState"));
std::unique_ptr<LLStartupListener> LLStartUp::sListener(new LLStartupListener());
@ -1409,11 +1409,18 @@ bool idle_startup()
else
{
U32 num_retries = regionp->getNumSeedCapRetries();
if (num_retries > MAX_SEED_CAP_ATTEMPTS_BEFORE_LOGIN)
if (num_retries > MAX_SEED_CAP_ATTEMPTS_BEFORE_ABORT)
{
// Region will keep trying to get capabilities,
// but for now continue as if caps were granted
LLStartUp::setStartupState(STATE_SEED_CAP_GRANTED);
LL_WARNS("AppInit") << "Failed to get capabilities. Backing up to login screen!" << LL_ENDL;
if (gRememberPassword)
{
LLNotificationsUtil::add("LoginPacketNeverReceived", LLSD(), LLSD(), login_alert_status);
}
else
{
LLNotificationsUtil::add("LoginPacketNeverReceivedNoTP", LLSD(), LLSD(), login_alert_status);
}
reset_login();
}
else if (num_retries > 0)
{