LLFloaterAvatarPicker* LLFloaterAvatarPicker::show(select_callback_t callback,
												   BOOL allow_multiple,
												   BOOL closeOnSelect)
{
	// *TODO: Use a key to allow this not to be an effective singleton

	LLFloaterAvatarPicker* floater = getInstance();
	floater->open();
	
	floater->mSelectionCallback = callback;
	floater->setAllowMultiple(allow_multiple);
	floater->mNearMeListComplete = FALSE;
	floater->mCloseOnSelect = closeOnSelect;
	
	if (!closeOnSelect)
	{
		// Use Select/Close
		std::string select_string = floater->getString("Select");
		std::string close_string = floater->getString("Close");
		floater->getChild<LLButton>("ok_btn")->setLabel(select_string);
		floater->getChild<LLButton>("cancel_btn")->setLabel(close_string);
	}

	return floater;
}
LLFloaterAvatarPicker* LLFloaterAvatarPicker::show(select_callback_t callback,
												   BOOL allow_multiple,
												   BOOL closeOnSelect)
{
	// TODO: This class should not be a singleton as it's used in multiple places
	// and therefore can't be used simultaneously. -MG
	
	LLFloaterAvatarPicker* floater = sInstance ? sInstance : new LLFloaterAvatarPicker();
	floater->open();	/* Flawfinder: ignore */
	if(!sInstance)
	{
		sInstance = floater;
		floater->center();
	}
	
	floater->mSelectionCallback = callback;
	floater->setAllowMultiple(allow_multiple);
	floater->mNearMeListComplete = FALSE;
	floater->mCloseOnSelect = closeOnSelect;
	return floater;
}