diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llfloateravatarpicker.cpp | 46 |
1 files changed, 29 insertions, 17 deletions
diff --git a/linden/indra/newview/llfloateravatarpicker.cpp b/linden/indra/newview/llfloateravatarpicker.cpp index 3bb2462..16c15b0 100644 --- a/linden/indra/newview/llfloateravatarpicker.cpp +++ b/linden/indra/newview/llfloateravatarpicker.cpp | |||
@@ -197,29 +197,33 @@ void LLFloaterAvatarPicker::onList(LLUICtrl* ctrl, void* userdata) | |||
197 | } | 197 | } |
198 | } | 198 | } |
199 | 199 | ||
200 | // static callback for inventory picker (select from calling cards) | ||
200 | void LLFloaterAvatarPicker::onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action, void* data) | 201 | void LLFloaterAvatarPicker::onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action, void* data) |
201 | { | 202 | { |
202 | LLFloaterAvatarPicker* self = (LLFloaterAvatarPicker*)data; | 203 | LLFloaterAvatarPicker* self = (LLFloaterAvatarPicker*)data; |
203 | if (!self) | 204 | if (self) |
204 | { | 205 | { |
205 | return; | 206 | self->doSelectionChange( items, user_action, data ); |
206 | } | 207 | } |
208 | } | ||
207 | 209 | ||
208 | self->mAvatarIDs.clear(); | 210 | // Callback for inventory picker (select from calling cards) |
209 | self->mAvatarNames.clear(); | 211 | void LLFloaterAvatarPicker::doSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action, void* data) |
210 | 212 | { | |
211 | // if we have calling cards, disable select button until | 213 | if (!mListNames) |
212 | // the inventory picks a valid calling card | ||
213 | if (!items.empty()) | ||
214 | { | 214 | { |
215 | self->childSetEnabled("Select", FALSE); | 215 | return; |
216 | } | 216 | } |
217 | 217 | ||
218 | if (!self->mListNames) | 218 | std::vector<LLScrollListItem*> search_items = mListNames->getAllSelected(); |
219 | { | 219 | if ( search_items.size() == 0 ) |
220 | return; | 220 | { // Nothing selected in the search results |
221 | mAvatarIDs.clear(); | ||
222 | mAvatarNames.clear(); | ||
223 | childSetEnabled("Select", FALSE); | ||
221 | } | 224 | } |
222 | 225 | ||
226 | BOOL first_calling_card = TRUE; | ||
223 | std::deque<LLFolderViewItem*>::const_iterator item_it; | 227 | std::deque<LLFolderViewItem*>::const_iterator item_it; |
224 | for (item_it = items.begin(); item_it != items.end(); ++item_it) | 228 | for (item_it = items.begin(); item_it != items.end(); ++item_it) |
225 | { | 229 | { |
@@ -230,10 +234,18 @@ void LLFloaterAvatarPicker::onSelectionChange(const std::deque<LLFolderViewItem* | |||
230 | 234 | ||
231 | if (item) | 235 | if (item) |
232 | { | 236 | { |
233 | self->mAvatarIDs.push_back(item->getCreatorUUID()); | 237 | if ( first_calling_card ) |
234 | self->mAvatarNames.push_back(listenerp->getName()); | 238 | { // Have a calling card selected, so clear anything from the search panel |
235 | self->childSetEnabled("Select", TRUE); | 239 | first_calling_card = FALSE; |
236 | self->mListNames->deselectAllItems(); | 240 | mAvatarIDs.clear(); |
241 | mAvatarNames.clear(); | ||
242 | mListNames->deselectAllItems(); | ||
243 | } | ||
244 | |||
245 | // Add calling card info to the selected avatars | ||
246 | mAvatarIDs.push_back(item->getCreatorUUID()); | ||
247 | mAvatarNames.push_back(listenerp->getName()); | ||
248 | childSetEnabled("Select", TRUE); | ||
237 | } | 249 | } |
238 | } | 250 | } |
239 | } | 251 | } |