Example #1
0
// static
BOOL LLPanelLogin::areCredentialFieldsDirty()
{
	if (!sInstance)
	{
		llwarns << "Attempted getServer with no login view shown" << llendl;
	}
	else
	{
		std::string username = sInstance->getChild<LLUICtrl>("username_edit")->getValue().asString();
		LLStringUtil::trim(username);
		std::string password = sInstance->getChild<LLUICtrl>("password_edit")->getValue().asString();
		LLLineEditor* ctrl = sInstance->getChild<LLLineEditor>("username_edit");
		if(ctrl && ctrl->isDirty())
		{
			return true;
		}
		ctrl = sInstance->getChild<LLLineEditor>("password_edit");
		if(ctrl && ctrl->isDirty()) 
		{
			return true;
		}
	}
	return false;	
}
// static
void LLPanelLogin::onLastNameEditLostFocus(LLUICtrl* ctrl, void* data)
{
	if (sInstance)
	{
		LLLineEditor* edit = sInstance->getChild<LLLineEditor>("last_name_edit");
		if(ctrl == edit)
		{
			if (edit->isDirty())
			{
				clearPassword();
				LLViewerLogin::getInstance()->setNameEditted(true);
			}
		}
	}
}
// static
BOOL FSPanelLogin::areCredentialFieldsDirty()
{
	if (!sInstance)
	{
		LL_WARNS() << "Attempted getServer with no login view shown" << LL_ENDL;
	}
	else
	{
		LLComboBox* combo = sInstance->getChild<LLComboBox>("username_combo");
		if(combo && combo->isDirty())
		{
			return true;
		}
		LLLineEditor* ctrl = sInstance->getChild<LLLineEditor>("password_edit");
		if(ctrl && ctrl->isDirty()) 
		{
			return true;
		}
	}
	return false;
}