当前位置: 首页>>代码示例>>C++>>正文


C++ LLFloaterPostcard::childGetValue方法代码示例

本文整理汇总了C++中LLFloaterPostcard::childGetValue方法的典型用法代码示例。如果您正苦于以下问题:C++ LLFloaterPostcard::childGetValue方法的具体用法?C++ LLFloaterPostcard::childGetValue怎么用?C++ LLFloaterPostcard::childGetValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LLFloaterPostcard的用法示例。


在下文中一共展示了LLFloaterPostcard::childGetValue方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: missingSubjMsgAlertCallback

void LLFloaterPostcard::missingSubjMsgAlertCallback(S32 option, void* data)
{
	if(data)
	{
		LLFloaterPostcard* self = static_cast<LLFloaterPostcard*>(data);
		if(0 == option)
		{
			// User clicked OK
			if((self->childGetValue("subject_form").asString()).empty())
			{
				// Stuff the subject back into the form.
				self->childSetValue("subject_form", self->childGetText("default_subject"));
			}

			if(!self->mHasFirstMsgFocus)
			{
				// The user never switched focus to the messagee window. 
				// Using the default string.
				self->childSetValue("msg_form", self->childGetText("default_message"));
			}

			self->sendPostcard();
		}
	}
}
开发者ID:Boy,项目名称:netbook,代码行数:25,代码来源:llfloaterpostcard.cpp

示例2: onClickSend

// static
void LLFloaterPostcard::onClickSend(void* data)
{
	if (data)
	{
		LLFloaterPostcard *self = (LLFloaterPostcard *)data;

		std::string from(self->childGetValue("from_form").asString());
		std::string to(self->childGetValue("to_form").asString());
		
		boost::regex emailFormat("[A-Za-z0-9.%+-_][email protected][A-Za-z0-9.-]+\\.[A-Za-z]{2,}(,[ \t]*[A-Za-z0-9.%+-_][email protected][A-Za-z0-9.-]+\\.[A-Za-z]{2,})*");
		
		if (to.empty() || !boost::regex_match(to, emailFormat))
		{
			LLNotifications::instance().add("PromptRecipientEmail");
			return;
		}

		if (from.empty() || !boost::regex_match(from, emailFormat))
		{
			LLNotifications::instance().add("PromptSelfEmail");
			return;
		}

		std::string subject(self->childGetValue("subject_form").asString());
		if(subject.empty() || !self->mHasFirstMsgFocus)
		{
			LLNotifications::instance().add("PromptMissingSubjMsg", LLSD(), LLSD(), boost::bind(&LLFloaterPostcard::missingSubjMsgAlertCallback, self, _1, _2));
			return;
		}

		if (self->mJPEGImage.notNull())
		{
			self->sendPostcard();
		}
		else
		{
			LLNotifications::instance().add("ErrorProcessingSnapshot");
		}
	}
}
开发者ID:VirtualReality,项目名称:Viewer,代码行数:41,代码来源:llfloaterpostcard.cpp

示例3: onClickSend

// static
void LLFloaterPostcard::onClickSend(void* data)
{
	if (data)
	{
		LLFloaterPostcard *self = (LLFloaterPostcard *)data;

		LLString from(self->childGetValue("from_form").asString().c_str());
		LLString to(self->childGetValue("to_form").asString().c_str());

		if (to.empty() || to.find('@') == std::string::npos)
		{
			gViewerWindow->alertXml("PromptRecipientEmail");
			return;
		}

		if (from.empty() || from.find('@') == std::string::npos)
		{
			gViewerWindow->alertXml("PromptSelfEmail");
			return;
		}

		LLString subject(self->childGetValue("subject_form").asString().c_str());
		if(subject.empty() || !self->mHasFirstMsgFocus)
		{
			gViewerWindow->alertXml("PromptMissingSubjMsg", missingSubjMsgAlertCallback, self);
			return;
		}

		if (self->mJPEGImage.notNull())
		{
			self->sendPostcard();
		}
		else
		{
			gViewerWindow->alertXml("ErrorProcessingSnapshot");
		}
	}
}
开发者ID:Boy,项目名称:netbook,代码行数:39,代码来源:llfloaterpostcard.cpp

示例4: updateUserInfo

// static
void LLFloaterPostcard::updateUserInfo(const std::string& email)
{
	for (instance_list_t::iterator iter = sInstances.begin();
		 iter != sInstances.end(); ++iter)
	{
		LLFloaterPostcard *instance = *iter;
		const std::string& text = instance->childGetValue("from_form").asString();
		if (text.empty())
		{
			// there's no text in this field yet, pre-populate
			instance->childSetValue("from_form", LLSD(email));
		}
	}
}
开发者ID:VirtualReality,项目名称:Viewer,代码行数:15,代码来源:llfloaterpostcard.cpp

示例5: uploadCallback

// static
void LLFloaterPostcard::uploadCallback(const LLUUID& asset_id, void *user_data, S32 result, LLExtStat ext_status) // StoreAssetData callback (fixed)
{
	LLFloaterPostcard *self = (LLFloaterPostcard *)user_data;
	
	LLUploadDialog::modalUploadFinished();
	
	if (result)
	{
		LLSD args;
		args["REASON"] = std::string(LLAssetStorage::getErrorString(result));
		LLNotifications::instance().add("ErrorUploadingPostcard", args);
	}
	else
	{
		// only create the postcard once the upload succeeds

		// request the postcard
		LLMessageSystem* msg = gMessageSystem;
		msg->newMessage("SendPostcard");
		msg->nextBlock("AgentData");
		msg->addUUID("AgentID", gAgent.getID());
		msg->addUUID("SessionID", gAgent.getSessionID());
		msg->addUUID("AssetID", self->mAssetID);
		msg->addVector3d("PosGlobal", self->mPosTakenGlobal);
		msg->addString("To", self->childGetValue("to_form").asString());
		msg->addString("From", self->childGetValue("from_form").asString());
		msg->addString("Name", self->childGetValue("name_form").asString());
		msg->addString("Subject", self->childGetValue("subject_form").asString());
		msg->addString("Msg", self->childGetValue("msg_form").asString());
		msg->addBOOL("AllowPublish", FALSE);
		msg->addBOOL("MaturePublish", FALSE);
		gAgent.sendReliableMessage();
	}

	self->close();
}
开发者ID:VirtualReality,项目名称:Viewer,代码行数:37,代码来源:llfloaterpostcard.cpp

示例6: updateUserInfo

// static
void LLFloaterPostcard::updateUserInfo(const char *email)
{
	LLFloaterPostcard *instance;

	sInstances.resetList();
	while ((instance = sInstances.getNextData()))
	{
		const LLString& text = instance->childGetValue("from_form").asString();
		if (text.empty())
		{
			// there's no text in this field yet, pre-populate
			instance->childSetValue("from_form", LLSD(email));
		}
	}
}
开发者ID:Boy,项目名称:netbook,代码行数:16,代码来源:llfloaterpostcard.cpp


注:本文中的LLFloaterPostcard::childGetValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。