diff options
| author | Dessie Linden <dessie@lindenlab.com> | 2010-05-14 09:11:17 -0700 |
|---|---|---|
| committer | Dessie Linden <dessie@lindenlab.com> | 2010-05-14 09:11:17 -0700 |
| commit | 5fe6a5489ccfea4772f4cd4e3310b98a71ff2bab (patch) | |
| tree | 74f791fe0470ae9528b552e87ff572851efab3da /indra/newview/llinventoryitemslist.cpp | |
| parent | c72d3b8bf40d7a6443345a9a53df5e6f7739a4b1 (diff) | |
| parent | d9f519d55c4b5cff0fa56d2130a7e25a144be9ff (diff) | |
Merged
Diffstat (limited to 'indra/newview/llinventoryitemslist.cpp')
| -rw-r--r-- | indra/newview/llinventoryitemslist.cpp | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/indra/newview/llinventoryitemslist.cpp b/indra/newview/llinventoryitemslist.cpp index f48e7b3966..2d1d401cd4 100644 --- a/indra/newview/llinventoryitemslist.cpp +++ b/indra/newview/llinventoryitemslist.cpp @@ -40,11 +40,13 @@ // llcommon #include "llcommonutils.h" +// llui #include "lliconctrl.h" +#include "lluitextutil.h" +#include "llcallbacklist.h" #include "llinventoryfunctions.h" #include "llinventorymodel.h" -#include "lltextutil.h" #include "lltrans.h" //////////////////////////////////////////////////////////////////////////////// @@ -320,6 +322,7 @@ LLInventoryItemsList::Params::Params() LLInventoryItemsList::LLInventoryItemsList(const LLInventoryItemsList::Params& p) : LLFlatListViewEx(p) , mNeedsRefresh(false) +, mPrevVisibility(false) { // TODO: mCommitOnSelectionChange is set to "false" in LLFlatListView // but reset to true in all derived classes. This settings might need to @@ -327,6 +330,8 @@ LLInventoryItemsList::LLInventoryItemsList(const LLInventoryItemsList::Params& p setCommitOnSelectionChange(true); setNoFilteredItemsMsg(LLTrans::getString("InventoryNoMatchingItems")); + + gIdleCallbacks.addFunction(idle, this); } // virtual @@ -344,12 +349,31 @@ void LLInventoryItemsList::refreshList(const LLInventoryModel::item_array_t item mNeedsRefresh = true; } -void LLInventoryItemsList::draw() +boost::signals2::connection LLInventoryItemsList::setRefreshCompleteCallback(const commit_signal_t::slot_type& cb) { - LLFlatListViewEx::draw(); - if(mNeedsRefresh) + return mRefreshCompleteSignal.connect(cb); +} + +void LLInventoryItemsList::doIdle() +{ + bool cur_visibility = getVisible(); + if(cur_visibility != mPrevVisibility || mNeedsRefresh) { refresh(); + + mRefreshCompleteSignal(this, LLSD()); + + mPrevVisibility = getVisible(); + } +} + +//static +void LLInventoryItemsList::idle(void* user_data) +{ + LLInventoryItemsList* self = static_cast<LLInventoryItemsList*>(user_data); + if ( self ) + { // Do the real idle + self->doIdle(); } } |
