diff options
| author | Tofu Linden <tofu.linden@lindenlab.com> | 2010-08-25 15:58:08 +0100 |
|---|---|---|
| committer | Tofu Linden <tofu.linden@lindenlab.com> | 2010-08-25 15:58:08 +0100 |
| commit | 1d89a80ba7293309fd4fbdd03b802c5c2998aac7 (patch) | |
| tree | 70eb3619b9a3df35687836d9daa328eb52ba85ab /indra/newview/llinventoryitemslist.cpp | |
| parent | 6fcde580c3a2e6cc62bfab52bd47cae8726c56d4 (diff) | |
| parent | e416840f85dc4a367894036b9fe483f17d959c54 (diff) | |
merge
Diffstat (limited to 'indra/newview/llinventoryitemslist.cpp')
| -rw-r--r-- | indra/newview/llinventoryitemslist.cpp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/indra/newview/llinventoryitemslist.cpp b/indra/newview/llinventoryitemslist.cpp index 2b81ba8a12..348d7ebcec 100644 --- a/indra/newview/llinventoryitemslist.cpp +++ b/indra/newview/llinventoryitemslist.cpp @@ -80,6 +80,37 @@ boost::signals2::connection LLInventoryItemsList::setRefreshCompleteCallback(con return mRefreshCompleteSignal.connect(cb); } +bool LLInventoryItemsList::selectItemByValue(const LLSD& value, bool select) +{ + if (!LLFlatListView::selectItemByValue(value, select) && !value.isUndefined()) + { + mSelectTheseIDs.push_back(value); + return false; + } + return true; +} + +void LLInventoryItemsList::updateSelection() +{ + if(mSelectTheseIDs.empty()) return; + + std::vector<LLSD> cur; + getValues(cur); + + for(std::vector<LLSD>::const_iterator cur_id_it = cur.begin(); cur_id_it != cur.end() && !mSelectTheseIDs.empty(); ++cur_id_it) + { + uuid_vec_t::iterator select_ids_it = std::find(mSelectTheseIDs.begin(), mSelectTheseIDs.end(), *cur_id_it); + if(select_ids_it != mSelectTheseIDs.end()) + { + selectItemByUUID(*select_ids_it); + mSelectTheseIDs.erase(select_ids_it); + } + } + + scrollToShowFirstSelectedItem(); + mSelectTheseIDs.clear(); +} + void LLInventoryItemsList::doIdle() { if (!mNeedsRefresh) return; @@ -148,6 +179,12 @@ void LLInventoryItemsList::refresh() bool needs_refresh = add_limit_exceeded; setNeedsRefresh(needs_refresh); setForceRefresh(needs_refresh); + + // After list building completed, select items that had been requested to select before list was build + if(!needs_refresh) + { + updateSelection(); + } } void LLInventoryItemsList::computeDifference( |
