Exemplo n.º 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());
	}
}
void LLPanelOutfitsInventory::onSelectorButtonClicked()
{
    LLFolderViewItem* cur_item = getRootFolder()->getCurSelectedItem();

    LLFolderViewEventListener* listenerp = cur_item->getListener();
    if (getIsCorrectType(listenerp))
    {
        LLSD key;
        key["type"] = "look";
        key["id"] = listenerp->getUUID();

        LLSideTray::getInstance()->showPanel("sidepanel_appearance", key);
    }
}
void LLPanelOutfitEdit::getCurrentItemUUID(LLUUID& selected_id)
{
	if (mInventoryItemsPanel->getVisible())
	{
		LLFolderViewItem* curr_item = mInventoryItemsPanel->getRootFolder()->getCurSelectedItem();
		if (!curr_item) return;

		LLFolderViewEventListener* listenerp  = curr_item->getListener();
		if (!listenerp) return;

		selected_id = listenerp->getUUID();
	}
	else if (mWearablesListViewPanel->getVisible())
	{
		selected_id = mWearableItemsList->getSelectedUUID();
	}
}
void LLLandmarksPanel::onSelectorButtonClicked()
{
	// TODO: mantipov: update getting of selected item
	// TODO: bind to "i" button
	LLFolderViewItem* cur_item = mFavoritesInventoryPanel->getRootFolder()->getCurSelectedItem();
	if (!cur_item) return;

	LLFolderViewEventListener* listenerp = cur_item->getListener();
	if (listenerp->getInventoryType() == LLInventoryType::IT_LANDMARK)
	{
		LLSD key;
		key["type"] = "landmark";
		key["id"] = listenerp->getUUID();

		LLSideTray::getInstance()->showPanel("panel_places", key);
	}
}
Exemplo n.º 5
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);
			}
		}
	}
}