diff options
| author | Christian Goetze <cg@lindenlab.com> | 2007-08-21 22:17:53 +0000 |
|---|---|---|
| committer | Christian Goetze <cg@lindenlab.com> | 2007-08-21 22:17:53 +0000 |
| commit | ce0a5fe14590b8d675b885fccd5f79d7ea17a302 (patch) | |
| tree | 3388e6f8ff02292ec4521d278c841801462945b8 /indra/newview/llfloateravatarpicker.cpp | |
| parent | b699ae454d8477d19342d320758cd993d1d28cec (diff) | |
EFFECTIVE MERGE: svn merge -r 66133:68118 svn+ssh://svn/svn/linden/branches/maintenance into release
Actual action: branched maintenance-r68118, merged in release, then copied result into release
Diffstat (limited to 'indra/newview/llfloateravatarpicker.cpp')
| -rw-r--r-- | indra/newview/llfloateravatarpicker.cpp | 46 |
1 files changed, 29 insertions, 17 deletions
diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp index 0ba0ab89b1..01296ddbae 100644 --- a/indra/newview/llfloateravatarpicker.cpp +++ b/indra/newview/llfloateravatarpicker.cpp @@ -177,29 +177,33 @@ void LLFloaterAvatarPicker::onList(LLUICtrl* ctrl, void* userdata) } } +// static callback for inventory picker (select from calling cards) void LLFloaterAvatarPicker::onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action, void* data) { LLFloaterAvatarPicker* self = (LLFloaterAvatarPicker*)data; - if (!self) + if (self) { - return; + self->doSelectionChange( items, user_action, data ); } +} - self->mAvatarIDs.clear(); - self->mAvatarNames.clear(); - - // if we have calling cards, disable select button until - // the inventory picks a valid calling card - if (!items.empty()) +// Callback for inventory picker (select from calling cards) +void LLFloaterAvatarPicker::doSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action, void* data) +{ + if (!mListNames) { - self->childSetEnabled("Select", FALSE); + return; } - if (!self->mListNames) - { - return; + std::vector<LLScrollListItem*> search_items = mListNames->getAllSelected(); + if ( search_items.size() == 0 ) + { // Nothing selected in the search results + mAvatarIDs.clear(); + mAvatarNames.clear(); + childSetEnabled("Select", FALSE); } - + + BOOL first_calling_card = TRUE; std::deque<LLFolderViewItem*>::const_iterator item_it; for (item_it = items.begin(); item_it != items.end(); ++item_it) { @@ -210,10 +214,18 @@ void LLFloaterAvatarPicker::onSelectionChange(const std::deque<LLFolderViewItem* if (item) { - self->mAvatarIDs.push_back(item->getCreatorUUID()); - self->mAvatarNames.push_back(listenerp->getName()); - self->childSetEnabled("Select", TRUE); - self->mListNames->deselectAllItems(); + if ( first_calling_card ) + { // Have a calling card selected, so clear anything from the search panel + first_calling_card = FALSE; + mAvatarIDs.clear(); + mAvatarNames.clear(); + mListNames->deselectAllItems(); + } + + // Add calling card info to the selected avatars + mAvatarIDs.push_back(item->getCreatorUUID()); + mAvatarNames.push_back(listenerp->getName()); + childSetEnabled("Select", TRUE); } } } |
