Пример #1
0
// Callback for inventory picker (select from calling cards)
void LLFloaterAvatarPicker::doCallingCardSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action, void* data)
{
	bool panel_active = (childGetVisibleTab("ResidentChooserTabs") == getChild<LLPanel>("CallingCardsPanel"));
	
	mSelectedInventoryAvatarIDs.clear();
	mSelectedInventoryAvatarNames.clear();
	
	if (panel_active)
	{
		childSetEnabled("Select", FALSE);
	}

	std::deque<LLFolderViewItem*>::const_iterator item_it;
	for (item_it = items.begin(); item_it != items.end(); ++item_it)
	{
		LLFolderViewEventListener* listenerp = (*item_it)->getListener();
		if (listenerp->getInventoryType() == LLInventoryType::IT_CALLINGCARD)
		{
			LLInventoryItem* item = gInventory.getItem(listenerp->getUUID());
			if (item)
			{
				mSelectedInventoryAvatarIDs.push_back(item->getCreatorUUID());
				mSelectedInventoryAvatarNames.push_back(listenerp->getName());
			}
		}
	}

	if (panel_active)
	{
		childSetEnabled("Select", visibleItemsSelected());
	}
}
Пример #2
0
// Callback for inventory picker (select from calling cards)
void LLFloaterAvatarPicker::doSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action, void* data)
{
	if (!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)
	{
		LLFolderViewEventListener* listenerp = (*item_it)->getListener();
		if (listenerp->getInventoryType() == LLInventoryType::IT_CALLINGCARD)
		{
			LLInventoryItem* item = gInventory.getItem(listenerp->getUUID());

			if (item)
			{
				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);
			}
		}
	}
}