From 9b9c3f03ac581d312ad61f433877979fba0614bb Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Tue, 24 Nov 2009 21:58:08 -0500 Subject: EXT-2386 : The very first time you log in as a new account, your inventory sidepanel is blank Changed the way that we're generating initial views for inventory panels. Instead of waiting for a notification, we check on idle and generate the views whenever we first see that the inventory has become usable. --HG-- branch : avatar-pipeline --- indra/newview/llinventorypanel.cpp | 22 ++++++++++++++++++---- indra/newview/llinventorypanel.h | 2 ++ 2 files changed, 20 insertions(+), 4 deletions(-) (limited to 'indra') diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 7168c33ce2..0c893dddd6 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -156,6 +156,8 @@ BOOL LLInventoryPanel::postBuild() initializeViews(); } + gIdleCallbacks.addFunction(onIdle, (void*)this); + if (mSortOrderSetting != INHERIT_SORT_ORDER) { setSortOrder(gSavedSettings.getU32(mSortOrderSetting)); @@ -255,13 +257,11 @@ void LLInventoryPanel::modelChanged(U32 mask) bool handled = false; - // inventory just initialized, do complete build - if ((mask & LLInventoryObserver::ADD) && mInventory->isInventoryUsable() && gInventory.getChangedIDs().empty() && !mViewsInitialized) + if (!mViewsInitialized) { - initializeViews(); return; } - + if (mask & LLInventoryObserver::LABEL) { handled = true; @@ -371,6 +371,20 @@ void LLInventoryPanel::modelChanged(U32 mask) } } +// static +void LLInventoryPanel::onIdle(void *userdata) +{ + LLInventoryPanel *self = (LLInventoryPanel*)userdata; + // inventory just initialized, do complete build + if (!self->mViewsInitialized && gInventory.isInventoryUsable()) + { + self->initializeViews(); + } + if (self->mViewsInitialized) + { + gIdleCallbacks.deleteFunction(onIdle, (void*)self); + } +} void LLInventoryPanel::initializeViews() { diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index 5b1104936d..fd23b375fa 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -160,6 +160,8 @@ public: void openSelected(); void unSelectAll() { mFolders->setSelection(NULL, FALSE, FALSE); } + static void onIdle(void* user_data); + private: // Given the id and the parent, build all of the folder views. -- cgit v1.2.3