コード例 #1
0
ファイル: llpaneldirplaces.cpp プロジェクト: Boy/netbook
// virtual
void LLPanelDirPlaces::performQuery()
{
	LLString name = childGetValue("name").asString();
	if (name.length() < mMinSearchChars)
	{
		return;
	}

	LLString catstring = childGetValue("Category").asString();
	
	// Because LLParcel::C_ANY is -1, must do special check
	S32 category = 0;
	if (catstring == "any")
	{
		category = LLParcel::C_ANY;
	}
	else
	{
		category = LLParcel::getCategoryFromString(catstring.c_str());
	}

	U32 flags = 0x0;
	bool adult_enabled = gAgent.canAccessAdult();
	bool mature_enabled = gAgent.canAccessMature();

	if (gSavedSettings.getBOOL("ShowPGSims") ||
	    (!adult_enabled && !mature_enabled)) // if they can't have either of the others checked, force this one true 
	{
		flags |= DFQ_INC_PG;
	}

	if( gSavedSettings.getBOOL("ShowMatureSims") && mature_enabled)
	{
		flags |= DFQ_INC_MATURE;
	}

	if( gSavedSettings.getBOOL("ShowAdultSims") && adult_enabled)
	{
		flags |= DFQ_INC_ADULT;
	}
	
	// Pack old query flag in case we are talking to an old server
	if ( ((flags & DFQ_INC_PG) == DFQ_INC_PG) && !((flags & DFQ_INC_MATURE) == DFQ_INC_MATURE) )
	{
		flags |= DFQ_PG_PARCELS_ONLY;
	}
 
	if (0x0 == flags)
	{
		LLNotifyBox::showXml("NoContentToSearch");
		return; 
	}

	queryCore(name, category, flags);
}
コード例 #2
0
void LLPanelDirPlaces::initialQuery()
{
	// All Linden locations in PG/Mature sims, any name.
	U32 flags = DFQ_INC_PG | DFQ_INC_MATURE;
	queryCore(LLStringUtil::null, LLParcel::C_LINDEN, flags);
}
コード例 #3
0
// virtual
void LLPanelDirPlaces::performQuery()
{
	std::string place_name = childGetValue("name").asString();
	if (place_name.length() < mMinSearchChars)
	{
		return;
	}

    // "hi " is three chars but not a long-enough search
	std::string query_string = place_name;
	LLStringUtil::trim( query_string );
	bool query_was_filtered = (query_string != place_name);

	// possible we threw away all the short words in the query so check length
	if ( query_string.length() < mMinSearchChars )
	{
		LLNotificationsUtil::add("SeachFilteredOnShortWordsEmpty");
		return;
	};

	// if we filtered something out, display a popup
	if ( query_was_filtered )
	{
		LLSD args;
		args["FINALQUERY"] = query_string;
		LLNotificationsUtil::add("SeachFilteredOnShortWords", args);
	};

	std::string catstring = childGetValue("Category").asString();
	if (gAgent.getAgentAccess().isInTransition())
	{
		// during the AO transition, this combo has an Adult item.
		// Post-transition, it goes away. We can remove this conditional
		// after the transition and just use the "else" clause.
		catstring = childGetValue("Category_Adult").asString();
	}
	else
	{
		// this is the code that should be preserved post-transition
		catstring = childGetValue("Category").asString();
	}
	
	
	// Because LLParcel::C_ANY is -1, must do special check
	S32 category = 0;
	if (catstring == "any")
	{
		category = LLParcel::C_ANY;
	}
	else
	{
		category = LLParcel::getCategoryFromString(catstring);
	}

	U32 flags = 0x0;
	bool adult_enabled = gAgent.canAccessAdult();
	bool mature_enabled = gAgent.canAccessMature();

	if (gSavedSettings.getBOOL("ShowPGSims") ||
	    (!adult_enabled && !mature_enabled)) // if they can't have either of the others checked, force this one true 
	{
		flags |= DFQ_INC_PG;
	}

	if( gSavedSettings.getBOOL("ShowMatureSims") && mature_enabled)
	{
		flags |= DFQ_INC_MATURE;
	}

	if( gSavedSettings.getBOOL("ShowAdultSims") && adult_enabled)
	{
		flags |= DFQ_INC_ADULT;
	}

	if (childGetValue("filter_gaming").asBoolean())
	{
		flags |= DFQ_FILTER_GAMING;
	}
	
	// Pack old query flag in case we are talking to an old server
	if ( ((flags & DFQ_INC_PG) == DFQ_INC_PG) && !((flags & DFQ_INC_MATURE) == DFQ_INC_MATURE) )
	{
		flags |= DFQ_PG_PARCELS_ONLY;
	}
 
	if (0x0 == flags)
	{
		LLNotificationsUtil::add("NoContentToSearch");
		return; 
	}
	
	queryCore(query_string, category, flags);
}
コード例 #4
0
ファイル: llpaneldirplaces.cpp プロジェクト: Boy/netbook
void LLPanelDirPlaces::initialQuery()
{
	// All Linden locations in PG/Mature sims, any name.
	const BOOL pg_only = FALSE;
	queryCore("", LLParcel::C_LINDEN, pg_only);
}