summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorLoren Shih <seraph@lindenlab.com>2009-11-24 21:58:08 -0500
committerLoren Shih <seraph@lindenlab.com>2009-11-24 21:58:08 -0500
commit9b9c3f03ac581d312ad61f433877979fba0614bb (patch)
treee765c8a5c03264c801c53a938c8db359dff9830d /indra
parent06fd219245e4540a79924146c889bcd11b5ffc80 (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')
-rw-r--r--indra/newview/llinventorypanel.cpp22
-rw-r--r--indra/newview/llinventorypanel.h2
2 files changed, 20 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()
{
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.