BOOL FloaterVoiceLicense::postBuild()
{	
	childSetAction("Continue", onContinue, this);
	childSetAction("Cancel", onCancel, this);
	childSetCommitCallback("agree_chk", updateAgree, this);

	// disable Agree to License radio button until the page has fully loaded
	LLCheckBoxCtrl* license_agreement = getChild<LLCheckBoxCtrl>("agree_chk");
	license_agreement->setEnabled( false );

	// hide the SL text widget if we're displaying license with using a browser widget.
	LLTextEditor *editor = getChild<LLTextEditor>("license_text");
	editor->setVisible( FALSE );

	LLMediaCtrl* web_browser = getChild<LLMediaCtrl>("license_html");
	if ( web_browser )
	{
		// start to observe it so we see navigate complete events
		web_browser->addObserver( this );
		std::string url = getString( "real_url" );
		if(url.substr(0,4) == "http") {
			gResponsePtr = LLIamHereVoice::build( this );
			LLHTTPClient::get( url, gResponsePtr );
		} else {
			setSiteIsAlive(false);
		}
	}

	return TRUE;
}
示例#2
0
BOOL LLFloaterTOS::postBuild()
{	
	childSetAction("Continue", onContinue, this);
	childSetAction("Cancel", onCancel, this);
	childSetCommitCallback("agree_chk", updateAgree, this);

	if ( mType != TOS_TOS )
	{
		// this displays the critical message
		LLTextEditor *editor = getChild<LLTextEditor>("tos_text");
		editor->setHandleEditKeysDirectly( TRUE );
		editor->setEnabled( FALSE );
		editor->setWordWrap(TRUE);
		editor->setFocus(TRUE);
		editor->setValue(LLSD(mMessage));

		return TRUE;
	}

	// disable Agree to TOS radio button until the page has fully loaded
	LLCheckBoxCtrl* tos_agreement = getChild<LLCheckBoxCtrl>("agree_chk");
	tos_agreement->setEnabled( false );

	// hide the SL text widget if we're displaying TOS with using a browser widget.
	LLTextEditor *editor = getChild<LLTextEditor>("tos_text");
	editor->setVisible( FALSE );

	LLMediaCtrl* web_browser = getChild<LLMediaCtrl>("tos_html");
	bool use_web_browser = false;

	//Check to see if the message is a link to display
	std::string token = "http://";
	std::string::size_type iIndex = mMessage.rfind(token);
	//IF it has http:// in it, we use the web browser
	if(iIndex != std::string::npos && mMessage.length() >= 2)
	{
		// it exists
		use_web_browser = true;
	}
	else if (gHippoGridManager->getConnectedGrid()->isSecondLife())
	{
		//Its SL, use the browser for it as thats what it should do
		use_web_browser = true;
	}

	if ( web_browser && use_web_browser)
	{
		web_browser->addObserver(this);
		gResponsePtr = LLIamHere::build( this );
		LLHTTPClient::get( getString( "real_url" ), gResponsePtr );
	}

	return TRUE;
}
示例#3
0
BOOL LLFloaterTOS::postBuild()
{	
	childSetAction("Continue", onContinue, this);
	childSetAction("Cancel", onCancel, this);
	childSetCommitCallback("agree_chk", updateAgree, this);

	if ( mType != TOS_TOS )
	{
		llinfos << "tos_type != TOS_TOS" << llendl;
		// this displays the critical message
		LLTextEditor *editor = getChild<LLTextEditor>("tos_text");
		editor->setHandleEditKeysDirectly( TRUE );
		editor->setEnabled( FALSE );
		editor->setWordWrap(TRUE);
		editor->setFocus(TRUE);
		// editor->setValue(LLSD(mMessage));
		editor->setValue(mMessage);

		return TRUE;
	}

	// disable Agree to TOS radio button until the page has fully loaded
	LLCheckBoxCtrl* tos_agreement = getChild<LLCheckBoxCtrl>("agree_chk");
	tos_agreement->setEnabled( false );

	// hide the SL text widget if we're displaying TOS with using a browser widget.
	LLTextEditor *editor = getChild<LLTextEditor>("tos_text");
	editor->setVisible(FALSE);

	LLWebBrowserCtrl* web_browser = getChild<LLWebBrowserCtrl>("tos_html");
	if ( web_browser )
	{
		// start to observe it so we see navigate complete events
		web_browser->addObserver( this );

		gResponsePtr = LLIamHereTOS::build( this );
		LLHTTPClient::head( getString( "real_url" ), gResponsePtr );
	}

	return TRUE;
}
BOOL HGFloaterTextEditor::postBuild(void)
{
	LLTextEditor* editor = getChild<LLTextEditor>("text_editor");
	mEditor = editor;

	childSetEnabled("upload_btn", false);
	childSetLabelArg("upload_btn", "[UPLOAD]", std::string("Upload"));
	childSetAction("upload_btn", onClickUpload, this);
	childSetEnabled("save_btn", false);
	childSetAction("save_btn", onClickSave, this);

	if(mItem)
	{
		std::string title = "Text editor: " + mItem->getName();
		const char* asset_type_name = LLAssetType::lookup(mItem->getType());
		if(asset_type_name)
		{
			title.append(" (" + std::string(asset_type_name) + ")");
		}
		setTitle(title);
	}
#if OPENSIM_RULES!=1
	if(mItem->getCreatorUUID() == gAgentID)
	{
#endif /* OPENSIM_RULES!=1 */
		// Load the asset
		editor->setVisible(FALSE);
		childSetText("status_text", std::string("Loading..."));
		LLInventoryBackup::download(mItem, this, imageCallback, assetCallback);
#if OPENSIM_RULES!=1
	} else {
		this->close(false);
	}
#endif /* OPENSIM_RULES!=1 */

	return TRUE;
}