void LLFloaterPathfindingObjects::updateStateOnListControls()
{
	switch (getMessagingState())
	{
	case kMessagingUnknown:
	case kMessagingGetRequestSent :
	case kMessagingSetRequestSent :
		mRefreshListButton->setEnabled(FALSE);
		mSelectAllButton->setEnabled(FALSE);
		mSelectNoneButton->setEnabled(FALSE);
		break;
	case kMessagingGetError :
	case kMessagingSetError :
	case kMessagingNotEnabled :
		mRefreshListButton->setEnabled(TRUE);
		mSelectAllButton->setEnabled(FALSE);
		mSelectNoneButton->setEnabled(FALSE);
		break;
	case kMessagingComplete :
		{
			int numItems = mObjectsScrollList->getItemCount();
			int numSelectedItems = mObjectsScrollList->getNumSelected();
			mRefreshListButton->setEnabled(TRUE);
			mSelectAllButton->setEnabled(numSelectedItems < numItems);
			mSelectNoneButton->setEnabled(numSelectedItems > 0);
		}
		break;
	default:
		llassert(0);
		break;
	}
}
void LLFloaterPathfindingLinksets::updateStateOnEditFields()
{
	int numSelectedItems = getNumSelectedObjects();
	bool isEditEnabled = (numSelectedItems > 0);

	mEditLinksetUse->setEnabled(isEditEnabled);

	mLabelWalkabilityCoefficients->setEnabled(isEditEnabled);
	mLabelEditA->setEnabled(isEditEnabled);
	mLabelEditB->setEnabled(isEditEnabled);
	mLabelEditC->setEnabled(isEditEnabled);
	mLabelEditD->setEnabled(isEditEnabled);
	mLabelSuggestedUseA->setEnabled(isEditEnabled);
	mLabelSuggestedUseB->setEnabled(isEditEnabled);
	mLabelSuggestedUseC->setEnabled(isEditEnabled);
	mLabelSuggestedUseD->setEnabled(isEditEnabled);
	mEditA->setEnabled(isEditEnabled);
	mEditB->setEnabled(isEditEnabled);
	mEditC->setEnabled(isEditEnabled);
	mEditD->setEnabled(isEditEnabled);

	mApplyEditsButton->setEnabled(isEditEnabled && (getMessagingState() == kMessagingComplete));
}
void LLFloaterPathfindingObjects::updateMessagingStatus()
{
	std::string statusText("");
	LLColor4 color;

	switch (getMessagingState())
	{
	case kMessagingUnknown:
		statusText = getString("messaging_initial");
		color = mErrorTextColor;
		break;
	case kMessagingGetRequestSent :
		statusText = getString("messaging_get_inprogress");
		color = mWarningTextColor;
		break;
	case kMessagingGetError :
		statusText = getString("messaging_get_error");
		color = mErrorTextColor;
		break;
	case kMessagingSetRequestSent :
		statusText = getString("messaging_set_inprogress");
		color = mWarningTextColor;
		break;
	case kMessagingSetError :
		statusText = getString("messaging_set_error");
		color = mErrorTextColor;
		break;
	case kMessagingComplete :
		if (mObjectsScrollList->isEmpty())
		{
			statusText = getString("messaging_complete_none_found");
		}
		else
		{
			S32 numItems = mObjectsScrollList->getItemCount();
			S32 numSelectedItems = mObjectsScrollList->getNumSelected();

			LLLocale locale(LLStringUtil::getLocale());
			std::string numItemsString;
			LLResMgr::getInstance()->getIntegerString(numItemsString, numItems);

			std::string numSelectedItemsString;
			LLResMgr::getInstance()->getIntegerString(numSelectedItemsString, numSelectedItems);

			LLStringUtil::format_map_t string_args;
			string_args["[NUM_SELECTED]"] = numSelectedItemsString;
			string_args["[NUM_TOTAL]"] = numItemsString;
			statusText = getString("messaging_complete_available", string_args);
		}
		color = LLUI::sColorsGroup->getColor("PathfindingGoodColor");
		break;
	case kMessagingNotEnabled :
		statusText = getString("messaging_not_enabled");
		color = mErrorTextColor;
		break;
	default:
		statusText = getString("messaging_initial");
		color = mErrorTextColor;
		llassert(0);
		break;
	}

	mMessagingStatus->setText((LLStringExplicit)statusText);
	mMessagingStatus->setColor(color);
}