//static
void LLFloaterAvatarPicker::editKeystroke(LLLineEditor* caller, void* user_data)
{
	LLFloaterAvatarPicker* self = (LLFloaterAvatarPicker*)user_data;
	LLPanel* active_panel = self->childGetVisibleTab("ResidentChooserTabs");
	if(active_panel == self->getChild<LLPanel>("SearchPanel"))
		self->childSetEnabled("Find", caller->getText().size() >= 3);
	else if(active_panel == self->getChild<LLPanel>("KeyPanel"))
	{
		LLUUID specified = self->getChild<LLLineEditor>("EditUUID")->getValue().asUUID();
		self->childSetEnabled("Select", specified.notNull());
	}
}
void LLFloaterAvatarPicker::onBtnSelect(void* userdata)
{
	LLFloaterAvatarPicker* self = (LLFloaterAvatarPicker*)userdata;

	if(self->mCallback)
	{
		LLPanel* active_panel = self->childGetVisibleTab("ResidentChooserTabs");

		if(active_panel == self->getChild<LLPanel>("CallingCardsPanel"))
		{
			self->mCallback(self->mSelectedInventoryAvatarNames, self->mSelectedInventoryAvatarIDs, self->mCallbackUserdata);
		}
		else if(active_panel == self->getChild<LLPanel>("SearchPanel"))
		{
			std::vector<std::string>	avatar_names;
			std::vector<LLUUID>			avatar_ids;
			getSelectedAvatarData(self->getChild<LLScrollListCtrl>("SearchResults"), avatar_names, avatar_ids);
			self->mCallback(avatar_names, avatar_ids, self->mCallbackUserdata);
		}
		else if(active_panel == self->getChild<LLPanel>("NearMePanel"))
		{
			std::vector<std::string>	avatar_names;
			std::vector<LLUUID>			avatar_ids;
			getSelectedAvatarData(self->getChild<LLScrollListCtrl>("NearMe"), avatar_names, avatar_ids);
			self->mCallback(avatar_names, avatar_ids, self->mCallbackUserdata);
		}
		else if(active_panel == self->getChild<LLPanel>("KeyPanel"))
		{
			LLUUID specified = self->getChild<LLLineEditor>("EditUUID")->getValue().asUUID();
			if(specified.isNull())
				return;
			std::vector<std::string>	avatar_names;
			std::vector<LLUUID>			avatar_ids;
			avatar_ids.push_back(specified);
			avatar_names.push_back(specified.asString());
			self->mCallback(avatar_names, avatar_ids, self->mCallbackUserdata);
		}
	}
	self->getChild<LLInventoryPanel>("InventoryPanel")->setSelection(LLUUID::null, FALSE);
	self->getChild<LLScrollListCtrl>("SearchResults")->deselectAllItems(TRUE);
	self->getChild<LLScrollListCtrl>("NearMe")->deselectAllItems(TRUE);
	if(self->mCloseOnSelect)
	{
		self->mCloseOnSelect = FALSE;
		self->close();		
	}
}
Esempio n. 3
0
void LLFloaterAvatarPicker::onBtnSelect(void* userdata)
{
	LLFloaterAvatarPicker* self = (LLFloaterAvatarPicker*)userdata;

	if(self->mCallback)
	{
		LLPanel* active_panel = self->childGetVisibleTab("ResidentChooserTabs");

		if(active_panel == self->getChild<LLPanel>("CallingCardsPanel"))
		{
			self->mCallback(self->mSelectedInventoryAvatarNames, self->mSelectedInventoryAvatarIDs, self->mCallbackUserdata);
		}
		else if(active_panel == self->getChild<LLPanel>("SearchPanel"))
		{
			std::vector<std::string>	avatar_names;
			std::vector<LLUUID>			avatar_ids;
			getSelectedAvatarData(self->getChild<LLScrollListCtrl>("SearchResults"), avatar_names, avatar_ids);
			self->mCallback(avatar_names, avatar_ids, self->mCallbackUserdata);
		}
		else if(active_panel == self->getChild<LLPanel>("NearMePanel"))
		{
			std::vector<std::string>	avatar_names;
			std::vector<LLUUID>			avatar_ids;
			getSelectedAvatarData(self->getChild<LLScrollListCtrl>("NearMe"), avatar_names, avatar_ids);
			self->mCallback(avatar_names, avatar_ids, self->mCallbackUserdata);
		}
	}
	if(self->init_cards)self->getChild<LLInventoryPanel>("InventoryPanel")->setSelection(LLUUID::null, FALSE);
	self->getChild<LLScrollListCtrl>("SearchResults")->deselectAllItems(TRUE);
	self->getChild<LLScrollListCtrl>("NearMe")->deselectAllItems(TRUE);
	if(self->mCloseOnSelect)
	{
		self->mCloseOnSelect = FALSE;
		self->close();		
	}
}