diff options
author | Loren Shih <seraph@lindenlab.com> | 2009-11-24 21:58:08 -0500 |
---|---|---|
committer | Loren Shih <seraph@lindenlab.com> | 2009-11-24 21:58:08 -0500 |
commit | 9b9c3f03ac581d312ad61f433877979fba0614bb (patch) | |
tree | e765c8a5c03264c801c53a938c8db359dff9830d /indra/newview/llinventorypanel.cpp | |
parent | 06fd219245e4540a79924146c889bcd11b5ffc80 (diff) |
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
Diffstat (limited to 'indra/newview/llinventorypanel.cpp')
-rw-r--r-- | indra/newview/llinventorypanel.cpp | 22 |
1 files changed, 18 insertions, 4 deletions
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() { |